View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Toppers Toppers is offline
external usenet poster
 
Posts: 4,339
Default How to get entries into a list box

Jill,
Some of the ways to populate a listbox.

(Xl2003)


HTH

Private Sub UserForm_Initialize()

ListBox1.RowSource = "Sheet2!a1:a10"
'
' OR
'

ListBox1.RowSource = "MyList" ' <=== Named range
'
' OR
'
For j = 1 To 10
ListBox1.AddItem "aa" & j ' or could be range("b" & j) or similar
Next j

End Sub

"Jill" wrote:

H, I'm attempting a program to enter data into a list box and I'm having a
few problems, this is my first attempt t a VBA list box. Thank you for any
help you can offer Thanks Jill