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
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.

- 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

- 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

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

- 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.

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

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

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!!
Read Also:
Top comments (0)