#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Listbox on a useform


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

Any ideas?

Thanks in advance.


--
ingleg
------------------------------------------------------------------------
ingleg's Profile: http://www.excelforum.com/member.php...o&userid=33037
View this thread: http://www.excelforum.com/showthread...hreadid=558494

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default Listbox on a useform

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"
wrote in message
...

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

Any ideas?

Thanks in advance.


--
ingleg
------------------------------------------------------------------------
ingleg's Profile:
http://www.excelforum.com/member.php...o&userid=33037
View this thread:
http://www.excelforum.com/showthread...hreadid=558494



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Listbox on a useform

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)

"ingleg" wrote in
message ...

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

Any ideas?

Thanks in advance.


--
ingleg
------------------------------------------------------------------------
ingleg's Profile:

http://www.excelforum.com/member.php...o&userid=33037
View this thread: http://www.excelforum.com/showthread...hreadid=558494



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default Listbox on a useform

ListFill should be RowSource.


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


"Chip Pearson" wrote in message
...
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"
wrote in message
...

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

Any ideas?

Thanks in advance.


--
ingleg
------------------------------------------------------------------------
ingleg's Profile:
http://www.excelforum.com/member.php...o&userid=33037
View this thread:
http://www.excelforum.com/showthread...hreadid=558494





  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Listbox on a useform


Thanks Chip.

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


--
ingleg
------------------------------------------------------------------------
ingleg's Profile: http://www.excelforum.com/member.php...o&userid=33037
View this thread: http://www.excelforum.com/showthread...hreadid=558494

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add Listbox header using VBA shirley_kee Excel Discussion (Misc queries) 2 May 17th 23 07:47 PM
Using a ListBox selection to query a database CLamar Excel Discussion (Misc queries) 1 June 1st 06 07:32 PM
Need help with Listbox Lizzie_S Excel Discussion (Misc queries) 3 July 22nd 05 03:42 AM
Help with Excel ActiveX listbox controls programmer123 Excel Discussion (Misc queries) 0 July 7th 05 10:30 PM
multiple columns / rows to be referenced through a listbox Hru48 Excel Discussion (Misc queries) 0 July 4th 05 04:12 PM


All times are GMT +1. The time now is 08:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"