How to Fix Excel VBA Worksheet_Change Event Not Running
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.

- 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.
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.
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).
Press ALT + F11 on your keyboard to launch the Visual Basic for Applications (VBA) editor.
In the Project Explorer pane on the left, find the name of the worksheet where you are actively typing or pasting the new data.
Double-click the source worksheet's name to open its code window. Paste your 'Private Sub Worksheet_Change(ByVal Target As Range)' macro here.
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').

Re-enable Application Events in VBA
If another macro crashed previously while executing, or deactivated events without turning them back on, the application will completely ignore new Worksheet_Change triggers.
Sort Upon Viewing Using Worksheet_Activate
Instead of executing a sorting macro every time a single source cell changes, you can optimize performance by triggering the sort only when the user navigates to the destination sheet.
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. Open your workbook in WPS: Launch WPS Office and open your macro-enabled spreadsheet (.xlsm).
- 2. Access the Developer tab: Navigate to the 'Developer' tab in the top ribbon menu to access macro features.
- 3. Open the VBA Editor: Click the 'Visual Basic' icon or press ALT + F11 to launch the macro editing environment.
- 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.

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.




