Fix Excel VBA Change Event Not Detecting RTD Link Updates
Question details
The user needs to run a VBA macro automatically when real-time data (RTD) updates in Excel, but the standard Worksheet_Change event is not triggering.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Monitoring real-time data feeds, such as stock market prices using RTD links, and attempting to trigger automated VBA scripts when the data values change.
- Observed behavior
- The Worksheet_Change event fails to fire because RTD link updates are processed as recalculation results rather than manual user edits or macro-driven changes.
Ensure that your workbook is saved in a Macro-Enabled format (.xlsm) and that you have enabled macros in the Trust Center settings so your event code can execute.
Use the Worksheet_Calculate Event to Monitor RTD Changes
Since RTD updates trigger a recalculation on the worksheet, utilizing the Calculate event alongside a static variable is the most effective way to detect when a value has changed.
The standard Worksheet_Change event only detects physical edits made by users or other macros. To catch RTD updates, you must monitor the recalculation phase. By storing the cell's previous value in a variable, you can compare it against the new value every time the sheet calculates. If they differ, the RTD link has updated.
Open the VBA Editor by pressing Alt + F11. Insert a standard module and declare a Public variable (e.g., Public PreviousValue As Variant) to hold the last known RTD value.
Double-click 'ThisWorkbook' in the Project Explorer and use the Workbook_Open event to assign the initial value of your RTD cell to your global variable.
Double-click the specific Sheet module where the RTD link is located. Select 'Worksheet' from the left dropdown menu and 'Calculate' from the right dropdown menu to create the Worksheet_Calculate subroutine.
Inside the Worksheet_Calculate event, write an IF statement that compares the current value of the RTD cell to your global variable. If they are different, run your desired macro code, and finally, update the global variable to match the new cell value.

Try WPS Office for Seamless Macro Compatibility
If you are dealing with complex Excel VBA limitations, WPS Office Spreadsheets offers robust compatibility with Microsoft Office file formats and VBA macros. It is lightweight, fast, and designed to handle extensive datasets without the hefty subscription costs.
- 1. Download and Install: Visit the WPS Office website and download the free installation package for your operating system.
- 2. Open Your Workbook: Launch WPS Spreadsheets and open your existing Macro-Enabled (.xlsm) files directly.
- 3. Enable Macros: Click 'Enable Macros' when prompted by the security warning to allow your VBA scripts and calculation events to run.

Frequently Asked Questions
Why doesn't the Worksheet_Change event fire for formula updates?
The Worksheet_Change event is specifically designed to trigger only when a user manually edits a cell or when a macro explicitly writes a value to it. Formula recalculations and RTD updates do not count as physical changes to the cell contents.
Can I use the Application.OnTime method instead of the Calculate event?
Yes, you can set up a recursive Application.OnTime macro to check cell values at regular intervals (e.g., every 5 seconds). However, the Worksheet_Calculate event is generally more responsive and efficient for detecting immediate data updates.
Does this solution work for DDE (Dynamic Data Exchange) links as well?
Yes. DDE links, much like RTD links, bypass the standard Change event. The Worksheet_Calculate method using a stored variable works effectively for both DDE and RTD updates.




