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


Currently, you're trying to add items to a combobox under a change
event. The combobox will populate if you enter a value in or somehow
change the text/value shown in a combobox. I think you're looking for
something that will load the combobox on start, in which case put the
code under a userform_initialize event. Something like this:

Private Sub UserForm_Initialize()
Dim MyArray As Variant
Dim Ctr As Integer

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

For Ctr = LBound(MyArray) To UBound(MyArray)
ComboBox1.AddItem MyArray(Ctr)
Next Ctr
End Sub


--
kev_06
------------------------------------------------------------------------
kev_06's Profile: http://www.excelforum.com/member.php...o&userid=35046
View this thread: http://www.excelforum.com/showthread...hreadid=556065