Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combo Box row Source
I want to add a combo box on a userform and want to give a list for the combo
box. How can I achieve that with out actually refering it to a list in a sheet. Is it possible to write the list in the vba code fro the combo box list? Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combo Box row Source
See the AddItem method in VBA help. Also look at the List method.
"art" wrote: I want to add a combo box on a userform and want to give a list for the combo box. How can I achieve that with out actually refering it to a list in a sheet. Is it possible to write the list in the vba code fro the combo box list? Thanks. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combo Box row Source
There are any number of ways to load the list of a combo box. Here are
three: Dim Arr() As String Dim N As Long ReDim Arr(1 To 10) For N = 1 To 10 Arr(N) = "Item" & CStr(N) Next N UserForm1.ComboBox1.List = Arr ' OR Dim V As Variant V = Array("One", "Two", "Three") UserForm1.ComboBox1.List = V ' OR For N = 1 To 10 UserForm1.ComboBox1.AddItem "Item" & CStr(N) Next N Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Sun, 19 Oct 2008 11:20:00 -0700, art wrote: I want to add a combo box on a userform and want to give a list for the combo box. How can I achieve that with out actually refering it to a list in a sheet. Is it possible to write the list in the vba code fro the combo box list? Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to find/edit combo box source? | New Users to Excel | |||
Combo Box Row source problem | Excel Programming | |||
Combo box Row source | Excel Programming | |||
Combo Source from another file | Excel Programming | |||
Source code for combo box in form | Excel Discussion (Misc queries) |