Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Options and Combo Boxes
I have two options in my data sheet. When the first option is clicked on, I
want a combobox to appear. When the second option is clicked on, I want a different combobox to appear in the same location as the first. I am having trouble writing the code for this. I would greatly appreciate it if someone could help me with this. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Options and Combo Boxes
Think laterally: use the same combo box but repopulate it when the
option is clicked. mtm4300 wrote: When the second option is clicked on, I want a different combobox to appear in the same location as the first. You can populate a combo box by setting it's .List property to an array variable (or it's .Column property, if the array is inconveniently-directed) Private Sub optFoo_Click() Dim arrList as Variant Dim iRow as Integer If Me.optFoo.Value=True Then 'Code to redimension and populate an array from source 1 arrList = ThisWorkbook.Names!myName.RefersToRange.Value Else 'Code to redimension and populate an array from source 2 Redim arrList(0 to 6, 0 to 1) ' List property is a zero-based array For iRow = 0 to 6 arrList(irow, 0) = Chr(64+ iRow) arrList(irow, 1) = iRow Next iRow Else Me.cboFoo2.Clear Me.cboFoo2.List = arrList Erase arrList End If |
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 | |||
Selecting subsets using combo boxes or list boxes | Excel Discussion (Misc queries) | |||
Questions on combo boxes and list boxes. | New Users to Excel | |||
Combo Boxes and Tick Boxes | Excel Programming | |||
List boxes/combo boxes | Excel Programming |