
- MS Excel Basics
- Excel - Home
- Excel - Getting Started
- Excel - Explore Window
- Excel - Backstage
- Excel - Entering Values
- Excel - Move Around
- Excel - Save Workbook
- Excel - Create Worksheet
- Excel - Copy Worksheet
- Excel - Hiding Worksheet
- Excel - Delete Worksheet
- Excel - Close Workbook
- Excel - Open Workbook
- Excel - Context Help
- Editing Worksheet
- Excel - Insert Data
- Excel - Select Data
- Excel - Delete Data
- Excel - Move Data
- Excel - Rows & Columns
- Excel - Copy & Paste
- Excel - Find & Replace
- Excel - Spell Check
- Excel - Zoom In-Out
- Excel - Special Symbols
- Excel - Insert Comments
- Excel - Add Text Box
- Excel - Undo Changes
- Formatting Cells
- Excel - Setting Cell Type
- Excel - Setting Fonts
- Excel - Text Decoration
- Excel - Rotate Cells
- Excel - Setting Colors
- Excel - Text Alignments
- Excel - Merge & Wrap
- Excel - Borders and Shades
- Excel - Apply Formatting
- Formatting Worksheets
- Excel - Sheet Options
- Excel - Adjust Margins
- Excel - Page Orientation
- Excel - Header and Footer
- Excel - Insert Page Breaks
- Excel - Set Background
- Excel - Freeze Panes
- Excel - Conditional Format
- Working with Formula
- Excel - Creating Formulas
- Excel - Copying Formulas
- Excel - Formula Reference
- Excel - Using Functions
- Excel - Builtin Functions
- Advanced Operations
- Excel - Data Filtering
- Excel - Data Sorting
- Excel - Using Ranges
- Excel - Data Validation
- Excel - Using Styles
- Excel - Using Themes
- Excel - Using Templates
- Excel - Using Macros
- Excel - Adding Graphics
- Excel - Cross Referencing
- Excel - Printing Worksheets
- Excel - Email Workbooks
- Excel- Translate Worksheet
- Excel - Workbook Security
- Excel - Data Tables
- Excel - Pivot Tables
- Excel - Simple Charts
- Excel - Pivot Charts
- Excel - Keyboard Shortcuts
- MS Excel Resources
- Excel - Quick Guide
- Excel - Useful Resources
- Excel - Discussion
How to Automatically Run a Macro When a Cell Formula Result Changes in Excel?
We need to run a macro by going to the Developer menu and selecting Run Macro or by using the shortcut we created. But have you ever tried to run a macro based on a cell value? It can be done by using the VBA application. In this process, we will automatically run the macro when the value of the specified range has changed. This tutorial will help you understand how we can automatically run macros when the result of a cell formula changes.
Here, we will first select the range of cells and then insert the VBA code for the sheet. Let us see an uncomplicated process to know how we can automatically run macros when cell formula results change in Excel. We need to use the help of a VBA application to complete our process, as we can’t do it by default in Excel.
Step 1
Consider an Excel sheet with data similar to the data shown in the image below, as well as a macro.

Now right-click on the sheet name and select View Code to open the VBA application, then type the programme into the text box as shown in the below image.
Example
Private Sub Worksheet_Calculate() 'Update By Nirmal Dim Xrg As Range Set Xrg = Range("A2:A12") If Not Intersect(Xrg, Range("A2:A12")) Is Nothing Then Macro1 End If End Sub
In the code, A2:A12 is the range of cells we formula on, and Macro1 is the name of the macro that will be run automatically.

Step 2
Then save the sheet as a macro-enabled workbook and exit the VBA application by pressing "Alt + Q", followed by closing the sheet. When we reopen the sheet, click on enable code, and every time we change the formula in the range, the macro will run automatically.

Note − The macro will only run if there is a change in the formula; it will not run if there is a change in any data.
Conclusion
In this tutorial, we used a simple example to demonstrate how we can automatically run macros when cell formula results change in Excel.
- Related Articles
- How to Automatically Reapply Auto-Filter When the Data Changes in Excel?
- How to Automatically Link a Cell Color to Another in Excel?
- How to Automatically Move the Cursor to a Specific Cell in Excel?
- How to Automatically Create Borders if a Cell has Contents in Excel?
- How to Automatically Expand the Formula Bar in Excel?
- How to Automatically Copy a Cell to Clipboard with a Single Click in Excel?
- How to Assign a Hotkey to a Specified Macro in Excel?
- How to Automatically Send Email Based on Cell Value in Excel?
- How to Automatically Open Files When Starting Excel?
- How to Automatically Enter Date When Data is Entered in a Column in Excel?
- How to Copy Cell Formula Only Not Formatting in Excel?
- How to Auto-Populate Date in a Cell when its Adjacent Cell is Updated in Excel?
- How to Copy Cell as Text Value Not Formula in Excel?
- How to Automatically Refresh a Pivot Table in Excel?
- How to Autofill Formula When Inserting Rows in Excel?
