How to Change Event To Run Macro When any Change is Made using Worksheet?
Tags: tochangeeventtorunma, vbamacros
Published: 2021-09-13 04:30:11

---
title: How to Change Event To Run Macro When any Change is Made using Worksheet?
published: true
date: 2021-09-06 18:12:20 UTC
tags: ToChangeEventToRunMa,VBAMacros
canonical_url: https://geekexcel.com/how-to-change-event-to-run-macro-when-any-change-is-made-using-worksheet/
---

In this tutorial, we will guide you on **how to change events to Run Macro when any change is made 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)
'your code
'
'
End Sub

```

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

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

- Now, you have to copy and paste the following code.

```
 Private Sub worksheet_change(ByVal Target As Range)
 Msgbox "You updated something in this sheet"
End Sub

```

- 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-Code-16.png)<figcaption>Save the Code</figcaption>

- Now, if you have this code on **sheet1,** and you **write or delete** something in the **sheet1** , the message will pop that **“You updated something in this sheet”.**

## Run Excel Macro if Any Change is Made on Worksheet

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

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

- Now, you have to go to **project explorer** and **double-click on the sheet** on which you want to trigger the **worksheet.change event**.
- Then, you have to put your **code** in this segment and call my subroutine that is in a module. So I simply call that subroutine in this worksheet event handler. My subroutine is **FormatUsingVBA() in Module1.**
- You need to  **copy and paste the code**  given below.

```
 Private Sub worksheet_change(ByVal Target As Range)
 Call FormatUsingVBA
End Sub

```

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

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

- Now, you have to make sure that your  **macro name is selected**  and click the  **Run ** button.
- Finally, you will get  **output ** as given below in the Excel.

## A Brief Synopsis

Here, we have explained the step-by-step procedure on **how to change events to Run Macro when any change is made 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/)**