Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
change list in combo box
I have a combo box called cb1 with a list of values (p1:p2). I have a secong
combo box cb2 that i would like the list to change depending on what is chosen in cb1. If the first option is chosen I'd like the data in cells Q1:Q8 to be the list and if the second option is chosen I'd like R1:R6 to be the list in CB2. Thanks for any help. Qaspec |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
change list in combo box
Hi,
Assuming your comboboxes are in a userform, then use: Private Sub cb1_Change() Dim pos As Long pos = cb1.ListIndex If pos = 0 Then 'Case first item is chosen cb2.RowSource = "Sheet1!Q1:Q8" ElseIf pos = 1 Then 'Case second item is chosen cb2.RowSource = "Sheet1!R1:R6" Else 'Case else cb2.RowSource = "" End If End Sub -- Regards, Sébastien <http://www.ondemandanalysis.com "Qaspec" wrote: I have a combo box called cb1 with a list of values (p1:p2). I have a secong combo box cb2 that i would like the list to change depending on what is chosen in cb1. If the first option is chosen I'd like the data in cells Q1:Q8 to be the list and if the second option is chosen I'd like R1:R6 to be the list in CB2. Thanks for any help. Qaspec |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Getting Combo boxes to change options based on other Combo boxes. | New Users to Excel | |||
List Box or Combo Box | Excel Discussion (Misc queries) | |||
List box or Combo box?? | Excel Discussion (Misc queries) | |||
Combo box or list box | Excel Discussion (Misc queries) | |||
Before and after combo box change | Excel Programming |