Private Sub UserForm_Initialize()
Set MonDico = CreateObject("Scripting.Dictionary")
For Each c In [type1]
If Not MonDico.Exists(UCase(c.Value)) And c <> "" Then
MonDico.Add UCase(c.Value), UCase(c.Value)
End If
Next c
Me.ComboBox1.List = MonDico.items
End Sub
Private Sub ComboBox1_Change()
Set MonDico = CreateObject("Scripting.Dictionary")
Me.ComboBox2.Clear
For Each c In [type2]
If UCase(c.Offset(0, -1)) = UCase(Me.ComboBox1) Then
If Not MonDico.Exists(UCase(c.Value)) And c <> "" Then
MonDico.Add UCase(c.Value), UCase(c.Value)
End If
End If
Next c
Me.ComboBox2.List = MonDico.items
End Sub
Private Sub ComboBox2_Change()
k = 0
Me.ListBox1.Clear
For Each c In [type1]
If UCase(c) = UCase(Me.ComboBox1) And UCase(c.Offset(0, 1)) = UCase(Me.ComboBox2) Then
Me.ListBox1.AddItem
Me.ListBox1.List(k, 0) = c.Offset(, 2)
Me.ListBox1.List(k, 1) = c.Offset(, 3)
Me.ListBox1.List(k, 2) = c.Offset(, 4)
Me.ListBox1.List(k, 3) = c.Offset(, -1)
k = k + 1
End If
Next c
End Sub
Private Sub ListBox1_Click()
Sheets("choix").[B5] = Me.ListBox1.Column(3)
End Sub