Fix Excel UserForm ComboBox Blank When Switching Worksheets
Question details
The user is experiencing an issue where a ComboBox inside a VBA UserForm loses its dropdown data when a different worksheet becomes active.
- Product
- Microsoft Excel / VBA
- Device & OS
- not provided
- Scenario
- Using an Excel VBA UserForm with a ComboBox that is populated via the RowSource property while navigating or switching between multiple worksheets.
- Observed behavior
- The ComboBox displays data correctly on the primary worksheet (Sheet1) but becomes completely blank when another worksheet is selected or activated.
Ensure you have saved a backup of your macro-enabled workbook (.xlsm) before modifying the UserForm properties or editing the VBA code.
Use Fully Qualified Worksheet References in RowSource
Update the RowSource property of your ComboBox to include the specific worksheet name, ensuring it doesn't automatically default to the currently active sheet.
When you assign a RowSource without explicitly specifying the worksheet name (for example, just typing 'N1:N35'), Excel assumes you are referencing the active sheet. If a user activates a different worksheet while the UserForm is open, the ComboBox attempts to pull data from that new active sheet's 'N1:N35' range, which is likely empty and results in blank entries.
Press 'Alt + F11' in your Excel workbook to launch the Visual Basic for Applications (VBA) editor.
In the Project Explorer panel on the left side, find your UserForm under the 'Forms' folder and double-click it to open the designer view.
Click on the affected ComboBox on the UserForm. If the Properties window is not visible, press 'F4' to open it.
In the Properties window, find the 'RowSource' field. Change the value to include the worksheet name wrapped in single quotes, followed by an exclamation mark. For example, change =N1:N35 to ='GENERAL DETAIL'!N1:N35.
Create and Manage VBA UserForms in WPS Spreadsheet
WPS Office offers a powerful Spreadsheet application with excellent VBA support, allowing you to run, edit, and fix UserForms just as you would in Microsoft Excel.
- 1. Open your Macro Workbook: Launch WPS Spreadsheet and open your .xlsm file containing the VBA UserForm.
- 2. Access the Developer Tools: Navigate to the 'Developer' tab on the top ribbon menu and click on the 'VBA Editor' button.
- 3. Edit the UserForm Property: Locate your UserForm in the Project Explorer, select the ComboBox, and update its RowSource property with the fully qualified worksheet reference.

Frequently Asked Questions
Why does a ComboBox RowSource change dynamically without my input?
If the RowSource property only lists a cell range (like A1:A10) without explicitly stating a worksheet name, Excel VBA resolves this reference against whatever worksheet is currently active at any given moment.
Can I populate a VBA ComboBox without using the RowSource property?
Yes. You can use the .AddItem method or assign an array directly to the .List property within the UserForm_Initialize event. This completely separates the ComboBox data from the active worksheet state.
Does the worksheet name need single quotes in the RowSource property?
It is highly recommended and absolutely required if your worksheet name contains spaces or special characters (e.g., 'GENERAL DETAIL'). Wrapping the name in single quotes ensures VBA parses the reference string correctly.
Why does my macro crash or fail when I switch between sheets?
VBA macros often fail when switching sheets if ranges and objects are implicitly referenced. You should always use fully qualified references, such as ThisWorkbook.Sheets("Sheet1").Range("A1"), rather than relying on the ActiveSheet.




