VBA Listbox question - Multiple Columns

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
20,638
Office Version
  1. 365
Platform
  1. Windows
OK, I'm trying the example from this page: VBA Listbox - A Complete Guide - Excel Macro Mastery

and I can't for the life of me get it to diplay more than 1 column.

1719349654362.png


This is my code I'm using:

VBA Code:
Private Sub UserForm_Initialize()
Dim c As Range, ws As Worksheet
Set ws = Worksheets("Brands")
With UserForm1.lstBrandsAvailable
    .Clear
    .RowSource = "Brands!" & Range(ws.Range("A2"), ws.Range("B2").End(xlDown)).Address
    .ColumnHeads = True
End With
End Sub

It brings back the data but only from Column A and I have verified in the immediate window that the address is correct.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
How about in the VBE properties window for the ListBox -> ColumnCount...
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,118
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top