Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Combo box
I have a variable named WhichCombo. This has a name of a combo box it in to
be used in the statment below. When I try this there is an error. How do I use the variable in the statment below for the combo box? Sheets("Sheet1").WhichCombo.AddItem Item |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Combo box
I used a combobox from the Control Toolbox toolbar. Is that what you used?
Option Explicit Sub testme02() Dim WhichCombo As String Dim myItem As String WhichCombo = "Combobox1" myItem = "hi there" Worksheets("Sheet1").OLEObjects(WhichCombo).Object .AddItem myItem End Sub Item looks too much like VBA's .Item property. I wouldn't use it as a variable name. pokdbz wrote: I have a variable named WhichCombo. This has a name of a combo box it in to be used in the statment below. When I try this there is an error. How do I use the variable in the statment below for the combo box? Sheets("Sheet1").WhichCombo.AddItem Item -- Dave Peterson |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Combo box
Yep thats what I needed.
"Dave Peterson" wrote: I used a combobox from the Control Toolbox toolbar. Is that what you used? Option Explicit Sub testme02() Dim WhichCombo As String Dim myItem As String WhichCombo = "Combobox1" myItem = "hi there" Worksheets("Sheet1").OLEObjects(WhichCombo).Object .AddItem myItem End Sub Item looks too much like VBA's .Item property. I wouldn't use it as a variable name. pokdbz wrote: I have a variable named WhichCombo. This has a name of a combo box it in to be used in the statment below. When I try this there is an error. How do I use the variable in the statment below for the combo box? Sheets("Sheet1").WhichCombo.AddItem Item -- Dave Peterson |
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 | |||
In Excel I need to set up a combo box based on another combo box. | Excel Discussion (Misc queries) | |||
"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) |