Listbox on a useform

I

ingleg

I am trying to add a listbox to a userform, but cannot work out how t
add a list to the listbox!

Any ideas?

Thanks in advance
 
C

Chip Pearson

If you want to fill the list with values from a worksheet range,
set the ListFill property to that range. Otherwise, use the
..AddItem method:

With UserForm1.ListBox1
.AddItem "a"
.AddItem "be"
.AddItem "c"
End With


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"ingleg" <[email protected]>
wrote in message
news:[email protected]...
 
B

Bob Phillips

You either add each item

With Listbox1
.Additem "Bob"
.AddItem "Jim"
'etc.

End With

or else you link it to a worksheet range, via the RowSource property.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
I

ingleg

Thanks Chip.

I tried the Row source previously, but must have mis-typed the cell
reference.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top