1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| Option Base 1
Private Sub UserForm_Initialize()
Dim LastLig As Long, j As Long
Dim i As Byte
Dim ColCrit
ColCrit = Array(2, 3, 4, 6, 7, 8, 9, 13, 15, 18, 19, 20, 23, 26, 27)
With Sheets("bras")
.AutoFilterMode = False
LastLig = .Cells(.Rows.Count, 1).End(xlUp).Row
For i = 1 To UBound(ColCrit)
For j = 2 To LastLig
Me.Controls("ComboBox" & i).Value = .Cells(j, ColCrit(i)).Value
If Me.Controls("ComboBox" & i).ListIndex = -1 Then Me.Controls("ComboBox" & i).AddItem .Cells(j, ColCrit(i)).Value
Me.Controls("ComboBox" & i).ListIndex = -1
Next j
Next i
End With
End Sub |
Partager