Option Explicit
Private Sub UserForm_Initialize()
Dim MonDico As Object
Dim c
With Feuil1 '''''''''''''''''''''''''''''''''''''''''REVOIR LE CODENAME de l'onglet
Set MonDico = CreateObject("Scripting.Dictionary")
For Each c In .Range(.[AN2], .Cells(Rows.Count, "AN").End(xlUp))
If Not MonDico.Exists(c.Value) And c.Value <> "" Then MonDico.Add c.Value, c.Value
Next c
Me.ComboBox1.List = MonDico.items
End With
End Sub
Private Sub ComboBox1_Change()
Dim MonDico As Object
Dim c
With Feuil1 ''''''''''''''''''REVOIR LE CODENAME de l'onglet
ComboBox2.Text = ""
Set MonDico = CreateObject("Scripting.Dictionary")
For Each c In .Range(.[AN2], .[AN65000].End(xlUp))
If ComboBox1.Text = c.Value Then
If Not MonDico.Exists(.Cells(c.Row, 1)) Then
MonDico.Add .Cells(c.Row, 1).Value, .Cells(c.Row, 1).Value
End If
End If
Next c
Me.ComboBox2.List = MonDico.items
End With
'Remplissage Combo2
End Sub
Private Sub CommandButton1_Click()
Unload UserForm1
End Sub