Combobox drop down

G

Guest

Help please

I have a userform combobox that is linked to other sheet.
I want to find a way in Visual Basic so that when an item is selected from
this drop
down menu, it returns a second list which I have in another sheet.

EXAMPLE: I click on the combobox to have the drop down list show. From this
drop down list, I want to be able to click on one of the items it has to
offer. Now the problem is: Once I click on this Item how do I make it so that
it shows a secondary list within the selected drop down item

Any Help greatly appreciated
 
G

Guest

hi,
on your form you would need two comboboxes. The first combobox would list
your rowsource for the first combobox. you would then need to add code using
the combobox1 change event to set the rowsource of the second combobox based
on the selection in the first combobox.
here i use test data from a project i helped a guy out on several week ago.
rowsource of combobox 1 is A2:A5
Private Sub CB1_Change()
If Me.CB1.Value = "nag" Then
Me.CB2.RowSource = "B2:B5"
Else
If Me.CB1.Value = "sway" Then
Me.CB2.RowSource = "C2:C5"
Else
If Me.CB1.Value = "runner" Then
Me.CB2.RowSource = "D2:D5"
Else
If Me.CB1.Value = "dilso" Then
Me.CB2.RowSource = "E2:E5"
End If
End If
End If
End If
End Sub

There is probable more than one way to do this but this is tested and works.

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