How to Run Macro If Any Change Made on Sheet in Specified Range?
Tags: torunmacroifanychang, vbamacros
Published: 2021-09-13 06:15:40

---
title: How to Run Macro If Any Change Made on Sheet in Specified Range?
published: true
date: 2021-09-07 12:52:33 UTC
tags: ToRunMacroIfAnyChang,VBAMacros
canonical_url: https://geekexcel.com/how-to-run-macro-if-any-change-made-on-sheet-in-specified-range/
---

In this tutorial, we will guide you on  **how to run Macro if any change is made on the sheet in specified range using Worksheet**. Let’s get them below!! Get an official version of MS Excel from the following link: **[https://www.microsoft.com/en-in/microsoft-365/excel](https://www.microsoft.com/en-in/microsoft-365/excel)**

## The Syntax for the Worksheet Change Event Handler

```
Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("your_range")) Is Nothing Then
      call your_macro
    End If
End Sub

```

## Run a VBA Macro When A change is made in range A2:A100

- Firstly, in the Excel Worksheet, you have to create **sheet 1 and sheet2**.
- Then, you have to go to the  **Developer Tab.**
- Now, you need to ** ** select the  **Visual Basic**  option under the  **Code**  section.

![Select Visual Basic](https://geekexcel.com/wp-content/uploads/2021/09/Select-Visual-Basic-9-1024x180.png)<figcaption>Select Visual Basic</figcaption>

- You have to go to  **project explorer**  and  **double-click on the sheet**  on which you want to trigger.
- In **sheet2** , you need to **copy below code** and make changes as per your requirement.

```
Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("A2:A100")) Is Nothing Then
      Call TestEvent
    End If
End Sub

```

![](https://geekexcel.com/wp-content/uploads/2021/09/Copy-the-Code.png)<figcaption>Copy the Code</figcaption>

- Then, you have to create **module1 and module2**.
- Now, in **module2** , you need to **copy and paste** the following code given below.

```
 Sub TestEvent()
 MsgBox "Event is working!"
End Sub

```

![](https://geekexcel.com/wp-content/uploads/2021/09/module-code.png)<figcaption>Copy the code</figcaption>

- After that, you need to  **save the code**  by selecting it and then  **close the window**.

![](https://geekexcel.com/wp-content/uploads/2021/09/Save-the-Code1-1.png)<figcaption>Save the Code</figcaption>

- Again, you have to go to the  **Excel Spreadsheet** , and click on the  **Developer Tab**.
- You need to choose the  **Macros option**  in the Code section.

![Choose Macro option](https://geekexcel.com/wp-content/uploads/2021/09/Choose-Macro-option-11-1024x184.png)<figcaption>Choose Macro option</figcaption>

- Now, you have to make sure that your  **macro name is selected**  and click the  **Run ** button.

![](https://geekexcel.com/wp-content/uploads/2021/09/Run-the-Code-7.png)<figcaption>Run the Code</figcaption>

- Finally, you will receive the **output as an Event is Working** dialog box in Microsoft Excel.

![](https://geekexcel.com/wp-content/uploads/2021/09/Final-Output.png)<figcaption>Output</figcaption>

## A Brief Synopsis

Here, we have explained the step-by-step procedure on **how to run Macro if any change is made on the sheet in a**  **specified range using Worksheet.** Make use of this. Please share your worthwhile  **feedback**  in the below  **comment**  section. To learn more, check out our website **[Geek Excel](https://geekexcel.com/)!!**

**Read Also:**

- **[How to Run a Macro Automatically Before Workbook Close in Excel?](https://geekexcel.com/how-to-run-a-macro-automatically-before-workbook-close-in-excel/)**
- **[How to Run a Macro Automatically When Workbook Opens in Excel?](https://geekexcel.com/how-to-run-a-macro-automatically-when-workbook-opens-in-excel/)**
- **[Excel Formulas to Find the Next Scheduled Event Date from Today!!](https://geekexcel.com/excel-formulas-to-find-the-next-scheduled-event-date-from-today/)**
- **[How to use the PROB function in Excel Spreadsheets?](https://geekexcel.com/how-to-use-the-prob-function-in-excel-spreadsheets/)**