Bonjour le forum
Bonjour reinruoff, QuentinATSA
Si tu n'as qu'une seule alternative ("Incident" ou "Accident"), tu places ces items dans un ComboBox ainsi tu n'auras pas à entrer les dites valeurs dans un TextBox ...
Très peu différent, le code serait :
Private Sub ComboBox1_Change()
Set Sh = Sheets("Feuil2")
If ComboBox1.Value = "Incident" Then
ComboBox2.List = Sh.Range("A1:A" & Sh.Range("A" & Rows.Count).End(xlUp).Row).Value
ElseIf ComboBox1.Value = "Accident" Then
ComboBox2.List = Sh.Range("B1:B" & Sh.Range("B" & Rows.Count).End(xlUp).Row).Value
End If
End Sub
Private Sub UserForm_Initialize()
ComboBox1.AddItem "Incident"
ComboBox1.AddItem "Accident"
End Sub
@+ Ericcool02