ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Combobox drop down (https://www.excelbanter.com/excel-discussion-misc-queries/146222-combobox-drop-down.html)

N.F

Combobox drop down
 
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



Toppers

Combobox drop down
 
As an alternative to VBA, look he

http://www.contextures.com/xlDataVal02.html

"N.F" wrote:

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



FSt1

Combobox drop down
 
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

"N.F" wrote:

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




All times are GMT +1. The time now is 12:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com