comboBoxes on a userform

L

LLoyd

Good Day.

I have done many comboBoxes on a userform, but now I now I need one comboBox
to look at another.

E.G
comboBox 1 has the district listed
comboBox 2 has the Facility listed
When you choice a district in comboBox1, then only the facilities belonging
to that district should show in comboBox 2.
On a sheet I do have the list of all the Districts in one col and list of
districts to Facility in two other col.

Thanks for your help
 
F

FSt1

hi
what you described sounds like cascading combos sometimes call dependent
combos. works something like this....
Private Sub ComboBox1_Change()
If Me.ComboBox1.Value = "1" Then
Me.ComboBox2.RowSource = "B5:B6"
Else
Me.ComboBox2.RowSource = "D5:D6"
End If
End Sub
this sample code is for a two option combo box. if you have more options
then add more ifs for the additional options.

regards
FSt1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top