View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Myrna Rodriguez Myrna Rodriguez is offline
external usenet poster
 
Posts: 23
Default Populate combo box for Userform in Excel 2002

Hi...
I created a UserForm containing 2 combo boxes.
UserForm will be used for data entry in excel.
I've enter the code in the module sheet.
When I run for module sheet, combo box displays list.
However when I run from Userform sheet, not successful.
Any guidance?? Where did I go wrong?
Thanks & have a happy day...
Myrna

This this code I've used:
Sub PopulateComboBox()
Dim MyArray As Variant
Dim MyStorage As Variant
Dim Ctr As Integer
MyArray = Array("Open", "Closed", "Cancelled")
MyStorage = Array("Open", "Archived", "Post-Close")
For Ctr = LBound(MyArray) To UBound(MyArray)
UserForm1.cbostatus.AddItem MyArray(Ctr)
UserForm1.cbostorage.AddItem MyStorage(Ctr)
Next

UserForm1.Show

End Sub



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!