Sub inicb1()
UserForm1.ListView1.ListItems.Clear
With Feuil1
drligne = .[a:b].Find("*", , , , 1, 2).Row
Set dico = CreateObject("Scripting.Dictionary")
For Each c In .Range("a2:a" & drligne)
If Not dico.Exists(c.Value) And c.Value <> "" Then dico.Add c.Value, c.Value
Next c
End With
a = dico.keys
With UserForm1
.ListView1.ListItems.Clear
.ListView1.View = lvwReport
.ListView1.Sorted = False
For k = 0 To dico.Count - 1
lg = lg + 1
.ListView1.ListItems.Add lg, , a(k)
Next
.ListView1.Sorted = True
For k = 1 To dico.Count
.ComboBox1.AddItem .ListView1.ListItems(k)
Next
.Show 0
End With
End Sub
Sub inicb2()
UserForm1.ListView1.ListItems.Clear
UserForm1.ComboBox2.Clear
With Feuil1
drligne = .[a:b].Find("*", , , , 1, 2).Row
Set dico = CreateObject("Scripting.Dictionary")
For Each c In .Range("b2:b" & drligne)
If Feuil1.Cells(c.Row, 1) = UserForm1.ComboBox1.Text Then
If Not dico.Exists(c.Value) And c.Value <> "" Then dico.Add c.Value, c.Value
End If
Next c
End With
a = dico.keys
With UserForm1
.ListView1.ListItems.Clear
.ListView1.View = lvwReport
.ListView1.Sorted = False
For k = 0 To dico.Count - 1
lg = lg + 1
.ListView1.ListItems.Add lg, , a(k)
Next
.ListView1.Sorted = True
For k = 1 To dico.Count
.ComboBox2.AddItem .ListView1.ListItems(k)
Next
End With
End Sub
Sub Bouton1_QuandClic()
Call inicb1
End Sub