To add items to a ComboBox in VBA, use the AddItem method inside the form's UserForm_Initialize procedure: ComboBox1.AddItem "Item". This fills the dropdown before the form appears. You can also use List with an array for bulk loading or RowSource to pull from a worksheet range. The steps below cover each method, plus common pitfalls and fixes.

What You'll Need

  • Excel (or another Office app) with the Developer tab enabled.
  • A UserForm containing a ComboBox control.
  • Basic familiarity with the VBA editor (Alt+F11).

Step-by-Step

  1. Open the VBA editor. Press Alt+F11. In the Project Explorer, find your workbook and expand it.
  2. Insert a UserForm. Right-click the project, choose Insert > UserForm. If you already have one, double-click it to open the form designer.
  3. Add a ComboBox. From the Toolbox, click the ComboBox icon and draw it on the form. The default name is ComboBox1; rename it in the Properties window if you prefer.
  4. Open the form's code module. Double-click the UserForm background (not a control) to open the code window. The left dropdown should show UserForm and the right dropdown Initialize.
  5. Write the AddItem code. Inside Private Sub UserForm_Initialize(), add one line per item:
    ComboBox1.AddItem "Red"
    ComboBox1.AddItem "Green"
    ComboBox1.AddItem "Blue"
    This runs each time the form loads, so the list is ready before the user sees it.
  6. Test the form. Press F5 while the UserForm is active. The dropdown should show Red, Green, Blue.
  7. Optional: load from an array. For many items, use List instead of repeated AddItem calls:
    ComboBox1.List = Array("Red", "Green", "Blue")
    This is faster and keeps the code compact.
  8. Optional: load from a worksheet range. If your items live in cells, set RowSource in the Properties window (e.g., Sheet1!A1:A10) or in code: ComboBox1.RowSource = "Sheet1!A1:A10". The range must exist when the form loads.
  9. Set a default selection. After adding items, use ComboBox1.ListIndex = 0 to preselect the first item, or -1 to leave nothing selected.
  10. Save and close. Save the workbook as .xlsm to keep macros. Close the form and reopen it to confirm the list persists.

Common Mistakes

  • Adding items in the wrong event. Code in UserForm_Click or ComboBox1_Change may run too late or repeatedly. Use UserForm_Initialize for one-time loading.
  • Duplicate items on reopen. If you call AddItem outside Initialize (e.g., in a button click), reopening the form can double the list. Clear first with ComboBox1.Clear.
  • RowSource and AddItem conflict. You cannot use both on the same ComboBox; setting RowSource clears any AddItem entries. Pick one method.
  • Wrong control name. If you renamed the ComboBox, update the code to match; otherwise you get a "method or data member not found" error.
  • Forgetting .xlsm. Macros are stripped from .xlsx files, so the form loads empty next time.

Tips

  • Use With ComboBox1 blocks to avoid repeating the control name.
  • For long lists, load from an array or range rather than dozens of AddItem lines.
  • Set MatchRequired = True if users must pick from the list rather than typing free text.
  • Use ListCount to check how many items loaded, which helps debugging.
  • Keep item text short; long strings get cut off in the dropdown width.

Troubleshooting

If the dropdown is empty, check that the code is in the UserForm module, not a standard module, and that the form actually runs Initialize (it fires when the form is shown, not when it is designed). If you see a "Could not set the RowSource property" error, the range name is wrong or the sheet is not visible; verify the sheet name and range. If items appear twice, add ComboBox1.Clear at the top of Initialize or move AddItem calls there. If the form crashes on load, comment out lines one at a time to find the offending control name. If the list works in the editor but not when opened normally, enable macros in the Trust Center.

Frequently Asked Questions

Can I add items to a ComboBox on a worksheet (not a UserForm)?

Yes, but the approach differs. Use the Forms control or ActiveX ComboBox and set its ListFillRange property, or use VBA with Shapes("ComboBox1").ControlFormat.AddItem for Forms controls. The AddItem method shown here applies to UserForm ComboBoxes.

How do I clear all items before reloading?

Call ComboBox1.Clear before adding new items. This removes everything, including any selection.

Why does my ComboBox show numbers instead of text?

If you load from a range with numeric values, the ComboBox may display them as numbers. Format the source cells as text or convert values with CStr before adding.

Can I add items from another workbook?

Yes, but RowSource cannot reference a closed workbook. Open the source workbook first, or copy the values into an array and use List.

How do I sort the items?

AddItem preserves the order you add them. To sort, load into an array, sort with a simple loop or worksheet function, then assign to List.

What is the maximum number of items?

The limit is large (tens of thousands), but performance drops with very long lists. For more than a few hundred items, consider a ListBox with a search box instead.