Bonjour à tous,
Je suis en train de faire un Userform avec quelque 300 combobox. La galère.
Bref je souhaite réduire le code ci-dessous.
Auriez vous une idée ou une piste à me donner ou même le code ^^?
Il y a toujours un step de 4 entre les combobox.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 For j = 2 To 5 '1 site CH ComboBox4 = Range("K" & j) If ComboBox4.ListIndex = -1 Then ComboBox4.AddItem Range("K" & j) ComboBox8 = Range("K" & j) If ComboBox8.ListIndex = -1 Then ComboBox8.AddItem Range("K" & j) ComboBox12 = Range("K" & j) If ComboBox12.ListIndex = -1 Then ComboBox12.AddItem Range("K" & j) ComboBox16 = Range("K" & j) If ComboBox16.ListIndex = -1 Then ComboBox16.AddItem Range("K" & j) ComboBox20 = Range("K" & j) If ComboBox20.ListIndex = -1 Then ComboBox20.AddItem Range("K" & j) ComboBox24 = Range("K" & j) If ComboBox24.ListIndex = -1 Then ComboBox24.AddItem Range("K" & j) ComboBox28 = Range("K" & j) If ComboBox28.ListIndex = -1 Then ComboBox28.AddItem Range("K" & j) ComboBox32 = Range("K" & j) If ComboBox32.ListIndex = -1 Then ComboBox32.AddItem Range("K" & j) ComboBox36 = Range("K" & j) If ComboBox36.ListIndex = -1 Then ComboBox36.AddItem Range("K" & j) ComboBox40 = Range("K" & j) If ComboBox40.ListIndex = -1 Then ComboBox40.AddItem Range("K" & j) next j
Merci et bonne journée.
Partager