How to Get Excel VBA Combobox with RowSource Named Range

The sample dataset has three columns, Name, ID, and Contact Number. The dataset ranges from B4 to D10.

dataset of excel vba combobox rowsource named range


Step 1 – Creating a ListBox

  • Press Alt + F11 to open the VBA editor.

creating a list box vba combobox rowsource named range

  • Go to the Insert tab.
  • Select the UserForm option.

creating a list box vba combobox rowsource named range

  • A userform with a toolbox will appear.

  • From the toolbox, select the ListBox option.

creating a list box vba combobox rowsource named range

  • A list box will appear in the userform.

creating a list box vba combobox rowsource named range


Step 2 – Renaming the Dataset

  • Select the cells from B4 to D10.
  • Double-click on the name box at the top left corner of the picture. You will see the name box is filled with the value B4.

  • Change the dataset name to CustomerList.


Step 3 – Changing the RowSource and Column Count

  • You will find a property box on the left side of the list box.

Changing the RowSource & Column Count vba combobox rowsource named range

  • Find the RowSource option in the property box.

Changing the RowSource & Column Count vba combobox rowsource named range

  • Change the resource to CustomerList.
  • Press Enter.

Changing the RowSource & Column Count vba combobox rowsource named range

  • Change the column count to 3.

Changing the RowSource & Column Count vba combobox rowsource named range

  • Press the Save icon and save the file.

Changing the RowSource & Column Count vba combobox rowsource named range

  • Press the Run icon or F5 button to show the list box in the Excel sheet.

Changing the RowSource & Column Count vba combobox rowsource named range

Read More: Create ComboBox with RowSource in Excel VBA


Step 4 – Final Result

  • After pressing the run button of the VBA window, the command will show the text box in the Excel worksheet just like the picture given below.


How to Create an Excel VBA ComboBox Using a Direct Range Reference

Steps:

  • Follow the steps described in the previous section of this article up to changing the RowSource.
  • Input the following RowSource name manually in the RowSource option.
Sheet2!B4:D10

  • The column count will remain the same as the previous one.
  • Press the Run button.
  • This command will show you the list box with the data of the table like the picture given below.


Things to Remember

  • If the Properties tab is not visible on the left pan, you may access it by right-clicking the ListBox1 window and selecting Properties.

Download the Practice Workbook


Related Articles

Get FREE Advanced Excel Exercises with Solutions!

Tags:

Souptik Roy
Souptik Roy

Souptik Roy, a BSc graduate in Naval Architecture and Marine Engineering from Bangladesh University of Engineering and Technology, dedicated 1.5 years to the ExcelDemy project. During this time, he authored 50+ articles and reviewed 20+ for ExcelDemy. Presently, he is a designer and content developer at YouHaveGotThisMath and Brainor, sister concerns of ExcelDemy. His educational content spans science, mathematics, and grammar. Roy's interests include developing creative ideas, visualizing concepts with tools like Adobe Illustrator, and problem-solving within Microsoft... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo