How to Make VBA Intersect Use the Correct Worksheet Range in Excel
Question details
The user needs to ensure that the VBA Intersect function targets the correct worksheet range without defaulting to the currently active worksheet.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Executing a VBA macro where the Intersect function is used to evaluate and return overlapping ranges across specific worksheets.
- Observed behavior
- Unqualified Rows or Columns references default to the active worksheet instead of the source worksheet, causing the Intersect function to return an incorrect range.
Verify that your VBA editor is open and you have located the specific module or Workbook_Open event containing the problematic Intersect code.
Qualify Range Properties Through Source Ranges
The most reliable way to ensure Intersect uses the correct worksheet is to explicitly qualify the EntireRow and EntireColumn properties to their parent ranges.
When unqualified range references (like Rows or Columns) are used in VBA, Excel defaults them to the currently active worksheet. This commonly causes Intersect errors if the target input ranges are located on a different, inactive sheet. By referencing the parent objects directly, you bypass the active worksheet limitation.
Press Alt + F11 on your keyboard to open the Microsoft Visual Basic for Applications editor.
Navigate to the specific module or event (such as Workbook_Open) where your Intersect variable is defined.
Modify your variable assignment to explicitly reference the source ranges. For example, change your code to: Set IntersectedRange = Intersect(rRow.EntireRow, rColumn.EntireColumn).
Run the macro again. The Intersect function will now correctly evaluate the ranges on the background worksheet without requiring you to use Select or Activate commands.
Isolate the Issue in a Simplified Workbook
If the Intersect function continues to return an incorrect range, isolate your code in a clean workbook to identify conflicting macros or event triggers.
Try WPS Office for Seamless Spreadsheet and VBA Handling
If you frequently encounter debugging issues or performance sluggishness while writing macros in Excel, WPS Office offers a highly compatible, lightweight alternative. Enjoy a familiar interface while managing your macro-enabled workbooks effortlessly.

Frequently Asked Questions
Why does VBA Intersect work only on the active sheet by default?
In VBA, if you do not explicitly state which worksheet a range object (like Rows or Columns) belongs to, the application automatically assumes you are referring to the currently active sheet. This leads to errors when your target data is on a background sheet.
Do I need to activate a worksheet before using Intersect in VBA?
No. Activating or selecting worksheets slows down your code and is generally considered poor practice. You can perform operations on any worksheet by explicitly qualifying your range objects with their specific worksheet reference.
How can I verify the exact range that Intersect is returning?
You can print the resulting range address to the Immediate window by adding the line `Debug.Print IntersectedRange.Address(External:=True)` to your code. This outputs the full path, including the worksheet name and cell coordinates, confirming the exact range captured.




