View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] hotbero@hotmail.com is offline
external usenet poster
 
Posts: 8
Default Fill a ListBox with items using VBA

Hi!

I would like to attach a ListBox, and/or a ComboBox to one of my
Sheets, "NOT A USERFORM".
How can I fill this ComboBox or ListBox with Items using VBA??

Sub Help()
Dim X As Single 'X could be 200
Dim Myarray() As Variant
'I have 1 ListBox named ListBox_1 and
'1 ComboBox named ComboBox_1 in my Sheet

MyArray=Array("AAA","BBB","CCC","DDD","EEE","FFF", "GGG","HHH")
FOR X=lbound(MyArray) to Ubound(MyArray)
ListBox_1.AddItem Myarray(X)
ComboBox_1.AddItem Myarray(X)
Next X

End Sub


This does not Work, Any Help???