VBA & Macro Problems

Populate an Excel VBA UserForm ComboBox with Full Names

Nimra MalikNimra Malik Nov 25, 2026 869 views

Question details

Populate a VBA UserForm ComboBox with full names assembled from separate worksheet columns.

Populate an Excel VBA UserForm ComboBox with Full Names
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet stores first and last names separately, and the user wants to display combined names in a UserForm without adding a formula column.
Observed behavior
The ComboBox should display each first and last name together when the UserForm opens.
Before you start

Confirm the worksheet name, the ComboBox name, and the columns and starting row containing the names. The example uses Sheet1, ComboBox1, first names in column E, last names in column F, and data starting in row 2.

Solution 1Recommended

Add full names when the Excel UserForm initializes

Use the UserForm Initialize event to combine names in memory and add them to the ComboBox without changing the worksheet.

1
Open the UserForm

In Excel, press Alt+F11 to open the VBA editor, then find and open your UserForm in the Project Explorer.

2
Clear the RowSource property

Select the ComboBox, press F4 to open Properties, and make sure RowSource is blank. This allows the code to populate the list.

3
Add the initialization code

Open the UserForm's code window and add the following event procedure. Replace Sheet1 and ComboBox1 if your names differ: Private Sub UserForm_Initialize() Dim sh As Worksheet Dim lastRow As Long Dim r As Long Set sh = ThisWorkbook.Worksheets("Sheet1") Me.ComboBox1.Clear lastRow = sh.Cells(sh.Rows.Count, "E").End(xlUp).Row For r = 2 To lastRow If sh.Cells(r, "E").Value <> "" Then Me.ComboBox1.AddItem Trim(sh.Cells(r, "E").Value & " " & sh.Cells(r, "F").Value) End If Next r End Sub

4
Save and test the form

Save the workbook as an Excel Macro-Enabled Workbook (.xlsm). In the VBA editor, select the UserForm and press F5 to run it, then open the ComboBox to check the names.

Add full names when the Excel UserForm initializes
How the last row is determined: The code finds the last populated row in column E and skips rows with a blank first name. Adjust the column references or condition if your data is arranged differently.
Free Microsoft Office alternative

Work with name lists in WPS Spreadsheets

WPS Office is a free, lightweight alternative with a familiar spreadsheet interface and support for common Excel formats, making it easy to move everyday name lists between applications. It does not fix Excel VBA UserForm issues; macro and UserForm compatibility may vary.

Organize and edit first and last names in worksheet columnsOpen and save common Excel formats, including XLSXUse a familiar interface for everyday spreadsheet workWork with spreadsheets in a lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why must the ComboBox RowSource be blank?

RowSource binds the ComboBox to a worksheet range. Clear it in the ComboBox Properties window before using Clear and AddItem to populate the list in code.

How do I use different columns for the names?

In the UserForm_Initialize procedure, change the column letters in sh.Cells(r, "E") and sh.Cells(r, "F"). Also change the column used to calculate lastRow if the first-name column has moved.

How can I populate a large list faster?

In UserForm_Initialize, read the two name columns into a VBA array, combine the names in memory, and assign the resulting array to the ComboBox List property. Keep RowSource blank.

Why does the list not populate when I reopen the workbook?

Check that the workbook is saved as an .xlsm file, that macros are enabled for the workbook, and that the code is in the UserForm's Initialize event rather than a standard module.