Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 05-29-2019, 07:32 PM
NoSparks NoSparks is offline Multi-select Combo Box with Item Descriptions Windows 7 64bit Multi-select Combo Box with Item Descriptions Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

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
with
Code:
Global gCodesAndDetailsListArr As Variant
In Worksheet_SelectionChange, replace
Code:
      gCodesListArr = Sheets("Codes").Range("A3:A67").Value
      gDetailsListArr = Sheets("Codes").Range("B3:B67").Value
with
Code:
      gCodesAndDetailsListArr = Sheets("Codes").Range("A3:B67").Value
In UserForm_Activate, replace
Code:
For Each element In gCodesListArr
  Me.ListBox1.AddItem element
  Next element
with
Code:
Me.ListBox1.List = gCodesAndDetailsListArr
Hope that helps.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi-select Combo Box with Item Descriptions Userform: Select Item, Multiple MailMerge Fields Populate 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
Multi-select Combo Box with Item Descriptions Multi-column combo box content control? sugarjay Word 1 03-21-2017 07:20 PM
Multi-select Combo Box with Item Descriptions Multi-select listbox help gvibe@hotmail.com Word VBA 1 07-19-2013 10:54 AM
Multi-select Combo Box with Item Descriptions Automatically select first item in drop-down? flackend Excel 4 08-29-2011 02:07 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:17 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft