Dependent Drop Downs in UserForms

cardinalphin

New Member
Joined
Nov 23, 2016
Messages
10
I'm trying to create a userform with dependent drop-down lists in it. I'm trying to populate these lists from various tables that I've got saved in a couple of sheets. I know how to use dependent drop-downs within the spreadsheet, but I can't find anything on how to do it within a userform.

The closest solution I've come up with is to populate all of these drop downs by hard coding the options into VBA. I've got almost 100 tables, and I will eventually have considerably more, so hard coding isn't really a good, manageable option.

I'm able to populate the parent list in the userform, using the tables, but I've come up empty in my search for a solution to linking to the child tables, within a userform. My apologies if this has been covered elsewhere, but I can't find anything that matches what I'm looking for.

I appreciate any help you can provide, and hope you have a great turkey day!
 

Some videos you may like

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,216
Office Version
  1. 365
Platform
  1. Windows
How are the tables linked?
 

cardinalphin

New Member
Joined
Nov 23, 2016
Messages
10
I'm not sure if this is what exactly you're asking, but I named the tables per the names from the parent tables. IE, I've got a table named machines, which contains several values, one of which is CTM. I've got another table named CTM. I can use data validation, and the indirect function to perform this in the spreadsheet, but that's not, at least from what I can tell, an option from within the userform.

Hopefully that's the information you were after. I haven't done anything else to link them together.

Thanks for your reply!
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,216
Office Version
  1. 365
Platform
  1. Windows
So if the user was to select CTM from the parent combobox the child combobox would be populated with data from the table CTM?
 

cardinalphin

New Member
Joined
Nov 23, 2016
Messages
10

ADVERTISEMENT

Correct. It seems to work pretty effortlessly using indirect and data validation...

Here's what I use in data validation to get to populate the child drop down list.
Code:
=INDIRECT($C$7)

Here's what I use to populate the parent list.
Code:
=INDIRECT("Components[Components]")
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,216
Office Version
  1. 365
Platform
  1. Windows
You could use something like this.
Code:
ComboBox2.List = Range(ComboBox1.Value).Value
 

Watch MrExcel Video

Forum statistics

Threads
1,122,295
Messages
5,595,294
Members
413,984
Latest member
stikpet

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top