1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| Private Sub UserForm_Initialize()
Set f = Sheets("feuil1")
Set mondicoA = CreateObject("Scripting.Dictionary")
For Each c In f.Range("A2", f.[A65000].End(xlUp))
If Not mondicoA.Exists(c.Value) Then mondicoA.Add c.Value, c.Value
Next c
'Me.ComboBox1.List = mondico.items
'Me.ComboBox1.ListIndex = 0
Me.ComboBox1.AddItem "*"
For Each i In mondicoA.items
Me.ComboBox1.AddItem i
Next
Me.ComboBox1.ListIndex = 0
End Sub
Private Sub ComboBox1_Change()
ComboBox2.Clear
For n = 2 To Range("B65536").End(xlUp).Row
If Range("B" & n) = ComboBox1 Then
ComboBox2.AddItem Range("E" & n)
End If
Next n
End Sub
Private Sub ComboBox2_Change()
ComboBox3.Clear
For n = 2 To Range("E65536").End(xlUp).Row
If Range("B" & n) = ComboBox1 And Range("E" & n) = ComboxBox2 Then
ComboBox2.AddItem Range("F" & n)
End If
Next n
End Sub |
Partager