Je ne comprends pas..... cela me dit que l'indice ne fait pas parti de la sélection.......
Private Sub UserForm_Initialize()
lst_nom_vpc.ColumnCount = 4
lst_nom_vpc.ColumnWidths = "0;50;80;50"
Dim d As Object, a, Tbl, i%, n%, cd As Boolean
Set d = CreateObject("Scripting.Dictionary")
With Worksheets("Données")
a = .Range("A2:Y" & .[D65000].End(xlUp).Row).Value
End With
For i = LBound(a) To UBound(a)
For n = 1 To 16
If a(i, n) = "" Then
cd = True: Exit For
End If
Next n
If a(i, 2) = "" Or a(i, 3) = "" Or a(i, 4) = "" Or a(i, 5) = ""Or a(i, 6) = ""Or a(i, 7) = ""Or a(i, 8) = "" Or a(i, 9) = "" Or a(i, 10) = "" Or a(i, 11) = "" Or a(i, 12) = "" Or a(i, 13) = "" Or a(i, 14) = "" Or a(i, 15) = ""Then d(i) = Array(a(i, 1), a(i, 4), a(i, 5), a(i, 6))
cd = False
Next i
n = d.Count
If n > 1 Then
Tbl = WorksheetFunction.Transpose(d.items)
Me.lst_nom_vpc.List = WorksheetFunction.Transpose(Tbl)
ElseIf n = 1 Then
Tbl = d.items
With Me.lst_nom_vpc
.AddItem Tbl(0)(0)
For i = 1 To 16
.List(0, i) = Tbl(0)(i)
Next i
End With
End If
End Sub