Listbox in VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I want to create a listbox in VBA. I have the error Run-Time #424 with the
following:
Private Sub UserForm1_initialize()
With ListBox1
..AddItem "macro1"
..AddItem "macro2"
..AddItem "macro3"
..AddItem "macro4"
..AddItem "macro5"
End With
End Sub
Thanks,
 
Hi,

The error would suggest that you do not have a control called listbox1
on the userform. Have you renamed the control?

Also the userform initialize event doesn't usually contain the userforms
name. May this should be.

Private Sub UserForm_Initialize()

Cheers
Andy
 
Back
Top