PDA

View Full Version : Dependent Combo Box in userform



Rocky9605
07-31-2018, 11:19 AM
Hi All,

I have a scenario where i have 2 combo box where in if i select Value User-1 from first combo box , second combo box values are A,B,C
and for User-2 it is D,E,F.

Now the challenge is Excel is not allowing - special character in my name manager.

Please let me know any workaround for this. Thanks in Advance !

sdsurzh
08-02-2018, 05:48 AM
Try this,

Private Sub ComboBox1_Change()
If ComboBox1.Value = "User-1" Then


ComboBox2.List = Array("A", "B", "C")
Else
ComboBox2.List = Array("D", "E", "F")
End If
End Sub



Private Sub UserForm_Initialize()
ComboBox1.List = Array("User-1", "User-2")
End Sub