Option Explicit
Dim Ws As Worksheet
Dim NbLignes As Integer
Private Sub UserForm3_Initialize()
Set Ws = Worksheets("Base")
NbLignes = Ws.Range("A65536").End(xlUp).Row
Alim_Combo 1
End Sub
Private Sub ComboBox1_Change()
Alim_Combo 2, ComboBox1.Value
End Sub
Private Sub ComboBox2_Change()
Alim_Combo 3, ComboBox2.Value
End Sub
Private Sub ComboBox3_Change()
Alim_Combo 4, ComboBox3.Value
End Sub
Private Sub Alim_Combo(CbxIndex As Integer, Optional Cible As Variant)
Dim j As Integer
Dim Obj As Control
Set Obj = Me.Controls("ComboBox" & CbxIndex)
Obj.Clear
If CbxIndex = 1 Then
For j = 2 To NbLignes
Obj = Ws.Range("A" & j)
'Remplit le ComboBox sans doublons
If Obj.ListIndex = -1 Then Obj.AddItem Ws.Range("A" & j)
Next j
Else
For j = 2 To NbLignes
If Ws.Range("A" & j).Offset(0, CbxIndex - 2) = Cible Then
Obj = Ws.Range("A" & j).Offset(0, CbxIndex - 1)
If Obj.ListIndex = -1 Then Obj.AddItem Ws.Range("A" & j).Offset(0, CbxIndex - 1)
End If
Next j
End If
End Sub