Re : doublons dans listbox suite choix combobox
bonjour Munity,Jean-Pirre
essaye le code suivant que je n'ai pas testé
ce serait tout de même plus facile avec un fichier
Private Sub UserForm_Initialize()
Dim Plg As Variant, Tbl As Variant, I As Integer, L As Integer
Dim Col As Collection, Item As Variant
With Sheets("Liste Prestations - Clients")
If .FilterMode = True Then .ShowAllData
Plg = .Range("a2:l" & .Range("a65536").End(xlUp).Row)
End With
Set Col = New Collection
For L = 1 To UBound(Plg, 1)
If Plg(L, 3) <> "Global" And Plg(L, 1) <> "DRH" Then
On Error Resume Next
Col.Add Plg(L, 5), CStr(Plg(L, 5))
On Error GoTo 0
End If
Next L
ReDim Tbl(1 To Col.Count, 1 To 2)
L = 0
For Each Item In Col
L = L + 1: Tbl(L, 1) = Item
Next Item
Set Col = Nothing
For L = 1 To UBound(Plg, 1)
For I = 1 To UBound(Tbl, 1)
If Tbl(I, 1) = Plg(L, 5) Then
Tbl(I, 2) = Plg(L, 7)
End If
Next I
Next L
With ListBox1
.Clear
.List = Tbl
End With
End Sub
à bientôt