VBA Listbox question - Multiple Columns

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
20,615
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

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
How about in the VBE properties window for the ListBox -> ColumnCount...
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,181
Members
452,615
Latest member
bogeys2birdies

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