Bonjour,
Un exemple simple de ce qu'il est possible de faire :
Dim MesDonnees(), Charge As Boolean
Private Sub ComboBox1_Change()
If ComboBox1 = "" Or Charge Then Exit Sub
ComboBox2.Clear
For i = LBound(MesDonnees, 1) To UBound(MesDonnees, 1)
If TextBox1.Value = MesDonnees(i, 1) And ComboBox1 = MesDonnees(i, 3) Then
ComboBox2.Value = MesDonnees(i, 2)
If ComboBox2.ListIndex = -1 Then ComboBox2.AddItem MesDonnees(i, 2)
End If
Next i
ComboBox2 = ""
End Sub
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim i As Long
Charge = True
ComboBox1.Clear
For i = LBound(MesDonnees, 1) To UBound(MesDonnees, 1)
If TextBox1.Value = MesDonnees(i, 1) Then
ComboBox1.Value = MesDonnees(i, 3)
If ComboBox1.ListIndex = -1 Then ComboBox1.AddItem MesDonnees(i, 3)
End If
Next i
Charge = False
ComboBox1 = ""
If ComboBox1.ListCount = 0 Then Cancel = True
End Sub
Private Sub UserForm_Initialize()
MesDonnees = Range("A6:C" & Range("A65536").End(xlUp).Row).Value
End Sub