How to add an array to a combo box with Excel 2003?
Hi Independe1019,
hwo come I do not see the items appear on the drop down list??
If no data is being loaded into the ComboBox,
check that you have amended:
- the workbook name
- the worksheet name
- the range address
This data should be amende in the following
assignments in my suggested code:
============
Set WB = Workbooks("myBook.xls") '<<==== CHANGE
Set SH = WB.Sheets("Sheet4") '<<==== CHANGE
Set rng = SH.Range("A1:A100") '<<==== CHANGE
============
If you have updated these assignment correctly
to reflect your scenario, and the specified data
range is populated, there is no reason for the
ComboBox to be loaded with your data.
Perhaps, however, your response is a reference
to the fact that, as written, no value will be
displayed in the ComboBox until the dropdown
arrow is clicked. If this is indeed your concern,
try replacing the last line of the Userform_Initialze
procedu
Me.ComboBox1.List = arr
with:
With Me.ComboBox1
.List = arr
.ListIndex = 0
End With
---
Regards,
Norman
|