View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default 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.