![]() |
#2
|
|||
|
|||
![]()
You don't need to loop through an array using AddItem to populate a listbox, you can make the listbox.list equal to the array,
and if the array is more than 1 column... so is the list but you need to adjust the column count property of the list box. This site is of interest for populating combo and list boxes. For what you've asked, I'd do this... In module1, replace Code:
Global gCodesListArr As Variant Global gDetailsListArr As Variant Code:
Global gCodesAndDetailsListArr As Variant Code:
gCodesListArr = Sheets("Codes").Range("A3:A67").Value gDetailsListArr = Sheets("Codes").Range("B3:B67").Value Code:
gCodesAndDetailsListArr = Sheets("Codes").Range("A3:B67").Value Code:
For Each element In gCodesListArr Me.ListBox1.AddItem element Next element Code:
Me.ListBox1.List = gCodesAndDetailsListArr |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
ericav68 | Word VBA | 4 | 05-11-2019 06:29 PM |
Multi-lined combo-box values | wwwk | Word VBA | 1 | 05-09-2017 03:26 AM |
![]() |
sugarjay | Word | 1 | 03-21-2017 07:20 PM |
![]() |
gvibe@hotmail.com | Word VBA | 1 | 07-19-2013 10:54 AM |
![]() |
flackend | Excel | 4 | 08-29-2011 02:07 PM |