Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combo Box Help
Hi all, hopefully someone can help me out. I have created a combo box (from the control toolbox), and have assigned a linked cell and a list fill range. I now want to create a 2nd combo box, that will bring back a second set of results based on the outcome of the first combo box. I know this can be done using data validation, however I am trying to get it done through VBA, so I can design a form for my colleagues to use. If the above was unclear, think Car manufacturers and models, depending on what car manufactuer is selected (viabox 1), I want only certain models to be shown in box2. Any help would be appreciated. -- towl ------------------------------------------------------------------------ towl's Profile: http://www.excelforum.com/member.php...o&userid=26340 View this thread: http://www.excelforum.com/showthread...hreadid=477582 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combo Box Help
In the click even of the first combobox, populate the second using add item
Private Sub Combobox1_Click() Dim rng as Range set rng = Range(combobox1.ListFillRange) ' combobox2 should not have a listfillrange assignment Combobox2.Clear for each cell in rng if cell.Value = Combobox1.Value then Combobox2.AddItem cell.offset(0,1).Value end if Next End Sub -- Regards, Tom Ogilvy "towl" wrote in message ... Hi all, hopefully someone can help me out. I have created a combo box (from the control toolbox), and have assigned a linked cell and a list fill range. I now want to create a 2nd combo box, that will bring back a second set of results based on the outcome of the first combo box. I know this can be done using data validation, however I am trying to get it done through VBA, so I can design a form for my colleagues to use. If the above was unclear, think Car manufacturers and models, depending on what car manufactuer is selected (viabox 1), I want only certain models to be shown in box2. Any help would be appreciated. -- towl ------------------------------------------------------------------------ towl's Profile: http://www.excelforum.com/member.php...o&userid=26340 View this thread: http://www.excelforum.com/showthread...hreadid=477582 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combo Box Help
Thanks for the help Tom, but still doesn't seem to be working, I have assigned a list name in Excel, that corresponds to the names i the combobox1 list, and it is this that I am wanting to pick up, gues I am trying to run before I can walk, as only started using Vba las week. Does anyone else have any ideas -- tow ----------------------------------------------------------------------- towl's Profile: http://www.excelforum.com/member.php...fo&userid=2634 View this thread: http://www.excelforum.com/showthread.php?threadid=47758 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combo Box Help
Private Sub Combobox1_Click()
If Combobox1.ListIndex < -1 then Combobox2.List = Range(Combobox1.Value).Value End if End Sub If you tell the whole story in the beginning, you increase your chances of getting a usable answer. Otherwise we have to guess to fill in the blanks. -- Regards, Tom Ogilvy "towl" wrote in message ... Thanks for the help Tom, but still doesn't seem to be working, I have assigned a list name in Excel, that corresponds to the names in the combobox1 list, and it is this that I am wanting to pick up, guess I am trying to run before I can walk, as only started using Vba last week. Does anyone else have any ideas? -- towl ------------------------------------------------------------------------ towl's Profile: http://www.excelforum.com/member.php...o&userid=26340 View this thread: http://www.excelforum.com/showthread...hreadid=477582 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
linking a form combo box... results from the combo box to another | Excel Discussion (Misc queries) | |||
combo reference on another combo box for picking address etc. | Excel Worksheet Functions | |||
Combo box values based on other combo box value | Excel Programming | |||
"Combo Box - getting control combo box to stick in place in worksh | Excel Discussion (Misc queries) | |||
"Combo Box - getting control combo box to stick in place in worksh | Excel Discussion (Misc queries) |