ComboBox

  • Thread starter Thread starter JLong
  • Start date Start date
J

JLong

I am use to add a two dimensional array to a combobox to
populate it, like this combobox.list=array(). In Excel I
couldn't do that, the combobox only has the ListFillRange
property. Is there a way of doing this without using the
FillRange prop.?
 
how about:

Option Explicit
Private Sub UserForm_Initialize()
Dim i As Long
Dim j As Long

Dim myArray(1 To 3, 1 To 2)
'set your values

For i = 1 To 3
For j = 1 To 2
myArray(i, j) = i & "--" & j
Next j
Next i

With Me.ComboBox1
.ColumnCount = 2
.List = myArray
End With
End Sub
 
Dave, that is what I normally do. I have never used Excel
VBA before and this combobox doesn't support the List
property. I am using Excel 2000.
 
Hmmm.

Where is your combobox? On a worksheet or on a userform?

And if it's on a worksheet, how did you make it? With the combobox icon from
the Control Toolbox toolbar or with the Dropdown icon from the Forms toolbar?
 
Back
Top