Private Sub ComboBox1_Change()
tableau = Sheets("continent").Range("A2:C" & Sheets("continent").Range("A65536").End(xlUp).Row)
ComboBox2.Clear: ComboBox3.Clear
Set coll = New Collection
For n = LBound(tableau, 1) To UBound(tableau, 1)
If ComboBox1 = tableau(n, 1) Then
On Error Resume Next
coll.Add tableau(n, 2), CStr(tableau(n, 2))
If Err.Number = 0 Then ComboBox2.AddItem tableau(n, 2)
On Error GoTo 0
End If
Next n
End Sub
Private Sub ComboBox2_Change()
tableau = Sheets("continent").Range("A2:C" & Sheets("continent").Range("A65536").End(xlUp).Row)
ComboBox3.Clear
Set coll = New Collection
For n = LBound(tableau, 1) To UBound(tableau, 1)
If ComboBox1 = tableau(n, 1) And ComboBox2 = tableau(n, 2) Then
On Error Resume Next
coll.Add tableau(n, 3), CStr(tableau(n, 3))
If Err.Number = 0 Then ComboBox3.AddItem tableau(n, 3)
On Error GoTo 0
End If
Next n
End Sub
Private Sub UserForm_Initialize()
tableau = Sheets("continent").Range("A2:C" & Sheets("continent").Range("A65536").End(xlUp).Row)
Set coll = New Collection
ComboBox1.AddItem "*"
For n = LBound(tableau, 1) To UBound(tableau, 1)
On Error Resume Next
coll.Add tableau(n, 1), CStr(tableau(n, 1))
If Err.Number = 0 Then ComboBox1.AddItem tableau(n, 1)
On Error GoTo 0
Next n
End Sub