VBA for combobox depending on value of another

Jannis

New member
Joined
May 15, 2020
Messages
16
Reaction score
0
Points
0
Excel Version(s)
2016
I have a spreadsheet (attached)
it has a userform with 4 comboboxes in it Depending on the value of the first combobox (rep names [Tom, Barry, Kim]), then combobox 2, 3 and 4 will have data drop down that pertains to that name
I have named ranges in cells A1-A6 called Tom, Cells A9 - A12 called barry, and A15-18 called kim
Example if Tom is selected in Combobox 1 then in Comboboxes 2, 3 , and 4 only Red, Green, Yellow, Blue will appear
if Barry is selected in combobox1 then in comboboxes 2,3 and 4 only purple, pink, brown and black will appear
if Kim is selected in Combobox1 then in comboboxes 2,3 and 4 only white, clear, Orange and grey will appear

I am looking for VBA to put into userform so I can place data on sheet 2 Combobox 1 into sheet 2 cell A1, Combobox2 into sheet 2 cell B1, Combobox3 into sheet2 cell C1 and combobox4 into sheet 2 cell D1

Any help would be FANTASTIC
 

Attachments

  • sample rep card.xlsm
    26.8 KB · Views: 24
Just use the event change for Combo1 to re-populate the rest of combos depending upon selected value in combo 1. And do not forget to clear them beofre re-populate
 
Could you point me to where I get some assistrance on how to incorperate this in my userform VBA please
 
Just go to your form, click the combo ComboBox4 you use for Rep Name, right click and go to see code. It will create a Sub ComboBox4_Change. Insert your code there that will be executed when that combo changes
 
Back
Top