VBA & Macro Problems

How to Fix Excel VBA Worksheet_Change Event Not Running

John WilsonJohn Wilson Nov 11, 2026 870 views

Question details

The user needs to understand why an Excel sorting macro successfully runs when triggered by a button, but fails to execute automatically via a Worksheet_Change event when source cells on a different worksheet are edited.

How to Fix Excel VBA Worksheet_Change Event Not Running
Product
Excel
Device & OS
not provided
Scenario
Attempting to automate a data sorting process so that updating a source cell automatically sorts data on a different destination worksheet.
Observed behavior
The macro works flawlessly when executed manually via a button click, but the automated Worksheet_Change event does not fire when changes are made to the cells on the separate sheet.
Before you start

Verify that your workbook is saved in a macro-enabled format (.xlsm or .xlsb) and that you have enabled macros in your spreadsheet application's Trust Center settings.

Solution 1Recommended

Move the Worksheet_Change Event to the Source Worksheet Module

The most common reason a Worksheet_Change event fails across sheets is improper placement. The code must reside in the background module of the sheet where the user is actually making the edits.

Worksheet events are specific to individual tabs. If you want a change on 'Sheet1' to sort data on 'Sheet2', your change event must be placed inside the 'Sheet1' module, not 'Sheet2', and not in a standard Module (like Module1).

1
Open the VBA Editor

Press ALT + F11 on your keyboard to launch the Visual Basic for Applications (VBA) editor.

2
Locate the source worksheet

In the Project Explorer pane on the left, find the name of the worksheet where you are actively typing or pasting the new data.

3
Move the event code

Double-click the source worksheet's name to open its code window. Paste your 'Private Sub Worksheet_Change(ByVal Target As Range)' macro here.

4
Update range references

Because the code is now running from the source sheet, ensure your sorting macro explicitly references the destination sheet (e.g., use 'Sheets("Destination").Range' instead of just 'Range').

Move the Worksheet_Change Event to the Source Worksheet Module
Target Range Check: Ensure your code includes an intersection check (e.g., 'If Not Intersect(Target, Range("A1:A10")) Is Nothing Then') so the sort does not run unnecessarily when irrelevant cells are changed.
Manage Macros in WPS Spreadsheet

Use WPS Spreadsheet for Seamless VBA and Macro Execution

WPS Office provides robust, built-in support for VBA macros, including complex Worksheet_Change events. You can easily manage, debug, and run your automated worksheet processes in an intuitive, highly compatible spreadsheet environment.

  1. 1. Open your workbook in WPS: Launch WPS Office and open your macro-enabled spreadsheet (.xlsm).
  2. 2. Access the Developer tab: Navigate to the 'Developer' tab in the top ribbon menu to access macro features.
  3. 3. Open the VBA Editor: Click the 'Visual Basic' icon or press ALT + F11 to launch the macro editing environment.
  4. 4. Manage your Worksheet events: Use the Project Explorer to locate your specific sheets and place your Worksheet_Change code directly into the correct sheet's background module.
Fully compatible with Microsoft Excel .xlsm and .xlsb macro-enabled formats.Features a built-in VBA editor to debug and manage Worksheet events seamlessly.Lightweight architecture ensures complex VBA automatic scripts run smoothly without causing application lag.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my macro work perfectly from a button but not in the Worksheet_Change event?

A button runs a standard macro typically stored in a standard module (like Module1). A Worksheet_Change event, however, is a built-in application trigger that only works when placed in the specific module of the worksheet where the edits are designated to happen. If the code is in the wrong sheet module or a standard module, Excel ignores it during cell edits.

Does recalculating formulas trigger a Worksheet_Change event?

No, formula recalculations do not trigger the Worksheet_Change event. If your data relies on formulas updating based on changes elsewhere, you must use the 'Worksheet_Calculate' event instead to trigger your sorting macro.

How do I stop Worksheet_Change from looping infinitely when the macro edits cells?

If your Worksheet_Change event modifies cells on the same sheet, it will trigger itself continually, causing Excel to crash. To prevent this, add 'Application.EnableEvents = False' at the very beginning of your code and 'Application.EnableEvents = True' just before the 'End Sub' line.

Can I monitor cell changes on all worksheets at once?

Yes. Instead of putting a Worksheet_Change event on every individual sheet, you can place your macro code inside the 'Workbook_SheetChange' event located within the 'ThisWorkbook' module. This captures targeted edits across the entire file automatically.