Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Set the Listindex property to 1
-- HTH RP (remove nothere from the email address if mailing direct) "windsurferLA" wrote in message ... I tried what you suggested with many variations and at first it seemed like no matter what I did, I could not load a list box with entries. Then, all of a sudden, it started working. I’m not sure why. Perhaps it started working after I clicked on the list box in the form window. The clicking action automatically opened a template macro in the UserForm1(code) sheet. Since then I’ve learned how to read which item in the list box was selected and to hide the box after the selection is made. My problem may have been that I had been concentrating on loading text into a combo box rather than a list box. When I would run the macro, the combo box would pop-up, but it would appear empty. It was not until accidentally clicked on the down arrow that I realized clicking the arrow was essential to getting the list to appear in the combo box. Thanks for the help. Bob Phillips wrote: Windsurfer, That's the trouble with reading a VB6 book and then trying to apply to VBA :-). In VB, when a form is loaded, it triggers the Form_Load event. But in VBA, it triggers the Userform_Initialize event. Try Private Sub Userform_Initialize() ListBox1.AddItem “test1” ListBox1.AddItem “test2” End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Combo Box/Drop down box | Excel Discussion (Misc queries) | |||
Using Drop Down List or Combo Box | Excel Worksheet Functions | |||
Drop Down List Box, Combo Box | Excel Discussion (Misc queries) | |||
Combo Box Drop Down Area | Excel Programming | |||
Setting the value of a cell from a combo box | Excel Programming |