ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to get a list of items onto a list box on a form (https://www.excelbanter.com/excel-programming/355465-how-get-list-items-onto-list-box-form.html)

Grd

How to get a list of items onto a list box on a form
 
Hi there,

I'm stuck and can't seem to figure out how to get a list that I have of 5
names onto a list box on a form I've created.

Anyone done this before.

Any help greatly appreciated

Thanks

Sandra

Jim Cone

How to get a list of items onto a list box on a form
 
Sandra,

Something like this in the code module for the form.
It runs every time the form is loaded (not when it's shown).
'-------------------------------------------
Private Sub UserForm_Initialize()
Dim varArray As Variant
varArray = Array("Larry", "Moe", "Curly", "Ashley", "Judd")
UserForm1.ListBox1.List = varArray
End Sub
'-------------------------------------------

Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware




"Grd"
wrote in message
Hi there,
I'm stuck and can't seem to figure out how to get a list that I have of 5
names onto a list box on a form I've created.
Anyone done this before.
Any help greatly appreciated
Thanks
Sandra

Grd

How to get a list of items onto a list box on a form
 
Thanks

this works well


"Jim Cone" wrote:

Sandra,

Something like this in the code module for the form.
It runs every time the form is loaded (not when it's shown).
'-------------------------------------------
Private Sub UserForm_Initialize()
Dim varArray As Variant
varArray = Array("Larry", "Moe", "Curly", "Ashley", "Judd")
UserForm1.ListBox1.List = varArray
End Sub
'-------------------------------------------

Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware




"Grd"
wrote in message
Hi there,
I'm stuck and can't seem to figure out how to get a list that I have of 5
names onto a list box on a form I've created.
Anyone done this before.
Any help greatly appreciated
Thanks
Sandra



All times are GMT +1. The time now is 01:55 AM.

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