View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
I Maycotte[_5_] I Maycotte[_5_] is offline
external usenet poster
 
Posts: 1
Default Populating a ComboBox in a UserForm


Hi everyone,

My main question is: how do I populate a combobox located in a userfor
with items from an array? I thought I would use .AddItem like I would
listbox, but it simply will not populate. Here is the code:


Code
-------------------
Private Sub ComboBox1_Change()
Dim MyArray As Variant
Dim Ctr As Integer

MyArray = Array("Item1", "Item2", "Item3", "Item4", "Item5")

For Ctr = LBound(MyArray) To UBound(MyArray)
SampleReport.ComboBox1.AddItem MyArray(Ctr)
Next Ctr
End Su
-------------------


Any advice? Thanks in advance.

-- Isaa

--
I Maycott
-----------------------------------------------------------------------
I Maycotte's Profile: http://www.excelforum.com/member.php...fo&userid=3560
View this thread: http://www.excelforum.com/showthread.php?threadid=55606