VBA & Macro Problems

Populate Multiple Columns in an Excel VBA ListBox

Olivia MillerOlivia Miller Nov 13, 2026 870 views

Question details

Display a primary value and additional information in a multiselect Excel VBA ListBox, then retrieve the first-column values from selected rows.

Product
Microsoft Excel VBA UserForm ListBox
Device & OS
not provided
Scenario
A single-column ListBox currently uses worksheet values and AddItem. The user wants to display a second column and adapt the code that copies selected values into worksheet cells.
Observed behavior
The ListBox populates, but the selection-handling code needs an explicit column index to retrieve the first-column value.
Before you start

Confirm the UserForm control is named ListBox1 and that Sheet1!A2:B20 contains the two columns you want to display. Open the Visual Basic Editor and use the UserForm's code module for statements that reference Me.ListBox1.

Solution 1Recommended

Populate a two-column ListBox from a worksheet range

Use RowSource to display adjacent worksheet columns without adding each item individually.

1
Prepare the source columns

In Excel, place the primary values in Sheet1 cells A2:A20 and the related information in B2:B20. Keep column headings outside this source range.

2
Set the ListBox properties

In the Visual Basic Editor, open the UserForm designer, select ListBox1, and open its Properties window. Set ColumnCount to 2, BoundColumn to 1, and MultiSelect to 1 - fmMultiSelectMulti or 2 - fmMultiSelectExtended.

3
Assign the worksheet range

Open the UserForm code module and add the following initialization procedure, or merge these statements into the existing one: Private Sub UserForm_Initialize() With Me.ListBox1 .ColumnCount = 2 .BoundColumn = 1 .ColumnWidths = "100 pt;150 pt" .RowSource = "Sheet1!A2:B20" End With End Sub Replace the sheet name and range with your actual source. Remove the old AddItem population loop when switching to RowSource.

4
Verify both columns appear

Run the UserForm and check that each row displays the primary value and its related information. If the second column is clipped, widen ListBox1 in the designer or adjust ColumnWidths.

BoundColumn and List use different indexing: BoundColumn = 1 identifies the first column, but List(row, column) uses zero-based indexes. Retrieve the first column with List(ii, 0). Do not use AddItem or RemoveItem while the ListBox is bound through RowSource.
Free Microsoft Office alternative

Manage worksheet lists in WPS Spreadsheet

WPS Office is a free, lightweight alternative with a familiar spreadsheet interface and Excel format compatibility for easy migration of worksheet data. Use WPS Spreadsheet to organize the source and output tables; it is not a fix for Excel VBA UserForm behavior, and this macro workflow requires a compatible VBA environment.

Organize primary values and related details in adjacent worksheet columns.Supports Microsoft Excel .xlsx and .xls formats for everyday spreadsheet work.Familiar spreadsheet controls make moving worksheet data straightforward.A lightweight option for reviewing and editing tables without relying on a VBA UserForm.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my ListBox show only one column when the source range has two?

Select ListBox1 in the UserForm designer and set ColumnCount to 2. Also check ColumnWidths: the second column must have a nonzero width, and the control must be wide enough to display it.

How do I retrieve the second-column value from a selected row?

Use Me.ListBox1.List(ii, 1), where ii is the row index. List uses zero-based column indexes, so 0 is the first column and 1 is the second.

Can I keep using AddItem after setting RowSource?

No. A ListBox bound through RowSource cannot be populated with AddItem. Remove the AddItem loop when using RowSource, or clear RowSource and use an unbound population method instead.

What if my worksheet name contains spaces?

Enclose the worksheet name in single quotation marks inside the RowSource string. For example, use Me.ListBox1.RowSource = "'Country Lists'!A2:B20".

Does BoundColumn = 1 automatically return every selected first-column value?

No. BoundColumn identifies the bound column, but it does not collect multiple selections. Loop from 0 to ListCount - 1, check Me.ListBox1.Selected(ii), and retrieve each selected value with Me.ListBox1.List(ii, 0).