![]() |
|
#1
|
|||
|
|||
|
How programmatically populate a single column listbox? Thanks
__________________
Backup your original file before doing any modification. |
|
#2
|
||||
|
||||
|
Is this a userform list box? With what do you want to populate it?
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
#3
|
|||
|
|||
|
Yes a userform VBA listbox. Thanks
__________________
Backup your original file before doing any modification. |
|
#4
|
||||
|
||||
|
So what do you want to populate it with?
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
#5
|
|||
|
|||
|
Thanks, I found that:
To populate a two column listbox: With UserForm.LB1 .ColumnCount = 2 .ColumnWidths = "6;6" .AddItem "1" .List(0, 0) = "Name1" .List(0, 1) = "E-mail1" .AddItem "2" .List(1, 0) = "Name2" .List(1, 1) = "E-mail2" .ListIndex = 1 ' Sets the default value End With To retrieve: First Column: UserForm.LB1.Column(0, .LB1.ListIndex) Second column: UserForm.LB1.Column(1, .LB1.ListIndex) To populate a single column listbox: With UserForm.LB1 .AddItem "Name1" .AddItem "Name2" .ListIndex = 1 End with To retrieve: UserForm.LB1.List(.LB1.ListIndex)
__________________
Backup your original file before doing any modification. |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Excel ListBox
|
koreggan | Excel | 1 | 04-23-2016 11:44 PM |
ListBox with multiple columns
|
Kaatje | Word VBA | 2 | 02-27-2016 09:37 AM |
| This is a Userform LIstbox queston: A variable does not set to the value of a listbox | CatMan | Excel Programming | 14 | 08-18-2014 08:14 PM |
This is a Userform LIstbox queston: A variable does not set to the value of a listbox
|
CatMan | Excel | 1 | 08-08-2014 09:41 AM |
| as the return value of another column, using Listbox? | marreco | Excel Programming | 1 | 03-27-2012 12:48 PM |