ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to get entries into a list box (https://www.excelbanter.com/excel-programming/350932-how-get-entries-into-list-box.html)

Jill

How to get entries into a list box
 
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

Toppers

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



All times are GMT +1. The time now is 03:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com