ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Listbox on a useform (https://www.excelbanter.com/excel-discussion-misc-queries/97593-listbox-useform.html)

ingleg

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


Chip Pearson

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




Bob Phillips

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




Chip Pearson

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






ingleg

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



All times are GMT +1. The time now is 11:58 PM.

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