VBA & Macro Problems

How to Fix Excel VBA Error 380: Invalid RowSource Property Value

John WilsonJohn Wilson Nov 11, 2026 868 views

Question details

The user is encountering VBA Error 380 ('Could not set the RowSource property. Invalid property value') and needs to correct the RowSource range string for a ListBox or ComboBox.

Product
Excel
Device & OS
not provided
Scenario
Setting up a UserForm in VBA with a ListBox or ComboBox that dynamically pulls data from a worksheet range.
Observed behavior
VBA triggers Error 380 because the RowSource property refers to an invalid worksheet range, an incorrect final row number, or a missing worksheet name.
Before you start

Before modifying your VBA script, verify the exact name of the worksheet containing your list data and ensure that your data range is not completely empty.

Solution 1Recommended

Verify and Correct the RowSource Syntax

Ensure the worksheet name is accurate and the dynamic row variable evaluates to a valid number in your VBA code.

Error 380 typically occurs when a property value is mathematically or syntactically invalid. In the context of a UserForm, the RowSource property of a list box or combo box must specify a precise and existing Excel range.

1
Check the Worksheet Name

Ensure the worksheet referenced in your RowSource string (e.g., 'Sheet1') exactly matches the tab name in your workbook. Check for accidental spaces.

2
Verify the Dynamic Row Variable

If you are appending a variable like 'irow' to the range string, confirm that it contains a valid numeric value greater than zero. The correct syntax should look like: .lstDatabase.RowSource = "Sheet1!A2:L" & irow.

3
Test with a Static Range

Temporarily replace your dynamic RowSource with a hardcoded string, such as .lstDatabase.RowSource = "Sheet1!A2:L100". If the form loads without Error 380, your dynamic variable is failing to calculate the correct row number.

Verify and Correct the RowSource Syntax
Dynamic Range Tip: Always calculate the last used row in your VBA script before defining the RowSource to avoid referencing empty or invalid ranges.
Advanced VBA Support

Debug and Run VBA Macros Easily with WPS Spreadsheet

WPS Office provides robust support for VBA macros. You can edit, debug, and execute your customized UserForms and macros using its intuitive built-in VBA editor.

  1. 1. Open your macro-enabled workbook: Launch WPS Spreadsheet and open your .xlsm file containing the VBA code.
  2. 2. Access the Developer Tools: Navigate to the 'Developer' tab on the top ribbon menu.
  3. 3. Launch the VBA Editor: Click on 'Visual Basic' or 'Macros' to open the code editor.
  4. 4. Fix and Run: Locate your UserForm code, correct the RowSource property syntax, and click the 'Run' button to test your form seamlessly.
Highly compatible with Microsoft Excel VBA scripts and UserFormsBuilt-in Developer tools for advanced data manipulationLightweight architecture for fast execution of complex macros
microsoft office alternative - wps office

Frequently Asked Questions

What does Error 380 'Invalid property value' mean in VBA?

This error occurs when you attempt to assign a value to a property that falls outside its acceptable format or range. For UserForms, it usually means the RowSource string is formatted incorrectly, points to a non-existent sheet, or references an invalid cell coordinate.

How do I dynamically find the last row for my RowSource?

You can find the last used row by using the script: irow = Sheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row. Assign this to your variable before setting the RowSource.

Why does my RowSource work with a hardcoded range but fail with a variable?

This happens if the variable is uninitialized, evaluates to zero, or returns an empty string at the exact moment the RowSource property is set. Ensure your variable calculation is placed before the RowSource assignment in your script.