deeppurple
XLDnaute Nouveau
<bonjour le forum,
j'ai 28 combobox avec 28 données différentes.
donc j'ai écrit ce code là 28 fois pour chaque combobox(sachant que mes combobox se suivent et vont de 12 à 39)
	
	
	
	
	
		
quand j'ai voulu testé mon userform, cela me marque " procédure trop grande"
je pense que faire une boucle serait la solution, mais je ne sais pas du tout comment utiliser les boucles
merci pour votre aide
	
		
			
		
		
	
				
			j'ai 28 combobox avec 28 données différentes.
donc j'ai écrit ce code là 28 fois pour chaque combobox(sachant que mes combobox se suivent et vont de 12 à 39)
		Code:
	
	
	Select Case ComboBox12
        Case "Cartes"
        Xls.Cells(lLig, 39) = TextBox868.Value
        Xls.Cells(lLig, 40) = TextBox854.Value
        Case "Cartes de paiement"
        Xls.Cells(lLig, 42) = TextBox868.Value
        Xls.Cells(lLig, 43) = TextBox854.Value
        Case "cartes riches"
        Xls.Cells(lLig, 45) = TextBox868.Value
        Xls.Cells(lLig, 46) = TextBox854.Value
        Case "claviers"
        Xls.Cells(lLig, 48) = TextBox868.Value
        Xls.Cells(lLig, 49) = TextBox854.Value
        Case "composants electro"
        Xls.Cells(lLig, 51) = TextBox868.Value
        Xls.Cells(lLig, 52) = TextBox854.Value
        Case "compteurs"
        Xls.Cells(lLig, 54) = TextBox868.Value
        Xls.Cells(lLig, 55) = TextBox854.Value
        Case "contacteurs/disjonct"
        Xls.Cells(lLig, 57) = TextBox868.Value
        Xls.Cells(lLig, 58) = TextBox854.Value
        Case "copieur"
        Xls.Cells(lLig, 60) = TextBox868.Value
        Xls.Cells(lLig, 61) = TextBox854.Value
        Case "deee"
        Xls.Cells(lLig, 63) = TextBox868.Value
        Xls.Cells(lLig, 64) = TextBox854.Value
        Case "disques durs"
        Xls.Cells(lLig, 66) = TextBox868.Value
        Xls.Cells(lLig, 67) = TextBox854.Value
        Case "écrans crt"
        Xls.Cells(lLig, 69) = TextBox868.Value
        Xls.Cells(lLig, 70) = TextBox854.Value
        Case "écrans tft"
        Xls.Cells(lLig, 72) = TextBox868.Value
        Xls.Cells(lLig, 73) = TextBox854.Value
        Case "electro portatif"
        Xls.Cells(lLig, 75) = TextBox868.Value
        Xls.Cells(lLig, 76) = TextBox854.Value
        Case "encre & toner"
        Xls.Cells(lLig, 78) = TextBox868.Value
        Xls.Cells(lLig, 79) = TextBox854.Value
        Case "imprimante"
        Xls.Cells(lLig, 81) = TextBox868.Value
        Xls.Cells(lLig, 82) = TextBox854.Value
        Case "manettes de jeux"
        Xls.Cells(lLig, 84) = TextBox868.Value
        Xls.Cells(lLig, 85) = TextBox854.Value
        Case "non valorisable"
        Xls.Cells(lLig, 87) = TextBox868.Value
        Xls.Cells(lLig, 88) = TextBox854.Value
        Case "onduleur"
        Xls.Cells(lLig, 90) = TextBox868.Value
        Xls.Cells(lLig, 91) = TextBox854.Value
        Case "papier"
        Xls.Cells(lLig, 93) = TextBox868.Value
        Xls.Cells(lLig, 94) = TextBox854.Value
        Case "papier sensible"
        Xls.Cells(lLig, 96) = TextBox868.Value
        Xls.Cells(lLig, 97) = TextBox854.Value
        Case "pc portable"
        Xls.Cells(lLig, 99) = TextBox868.Value
        Xls.Cells(lLig, 100) = TextBox854.Value
        Case "pe-ld"
        Xls.Cells(lLig, 102) = TextBox868.Value
        Xls.Cells(lLig, 103) = TextBox854.Value
        Case "piles alcalines"
        Xls.Cells(lLig, 105) = TextBox868.Value
        Xls.Cells(lLig, 106) = TextBox854.Value
        Case "serveur"
        Xls.Cells(lLig, 108) = TextBox868.Value
        Xls.Cells(lLig, 109) = TextBox854.Value
        Case "traceur"
        Xls.Cells(lLig, 111) = TextBox868.Value
        Xls.Cells(lLig, 112) = TextBox854.Value
        Case "tubes d'écrans"
        Xls.Cells(lLig, 114) = TextBox868.Value
        Xls.Cells(lLig, 115) = TextBox854.Value
        Case "tubes fluo"
        Xls.Cells(lLig, 117) = TextBox868.Value
        Xls.Cells(lLig, 118) = TextBox854.Value
        Case "uc"
        Xls.Cells(lLig, 120) = TextBox868.Value
        Xls.Cells(lLig, 121) = TextBox854.Value
        
        End Select
	quand j'ai voulu testé mon userform, cela me marque " procédure trop grande"
je pense que faire une boucle serait la solution, mais je ne sais pas du tout comment utiliser les boucles
merci pour votre aide