Excel VBA: Track If A Cell Value Changes - ExcelDemy
Có thể bạn quan tâm
In this article, I’ll show you how you can track if a cell value changes in a worksheet using VBA in Excel.
Excel VBA: Track If a Cell Value Changes (Quick View)
Public Sub Worksheet_Change(ByVal target As Range) MsgBox "The value changed in cell " & target.Address(0, 0) End Sub
How to Track If a Cell Value Changes in Excel VBA: 5 Easy Steps
So, without further delay, let’s move to our main discussion today. We aim to develop a system using Excel VBA that’ll track all the cells in a worksheet and notify us if any cell changes. For your better understanding, I’ve divided the whole process into a number of steps.
Let’s go to the step-by-step analysis of the whole process.
⧪ Step 1: Opening the Visual Basic Window
Press ALT + F11 on your keyboard to open the Visual Basic window.

⧪ Step 2: Opening the Code Editor of the Particular Worksheet
In the left panel of the Visual Basic window, you’ll get a VBA project that consists of all the worksheets of the active workbook. Right-click on the worksheet that you want to trach, and select View Code.
Here, I’ve right-clicked on Sheet1.

⧪ Step 3: Entering Code into the Editor
Now, it’s the time for the code. Put this VBA code into the editor.
⧭ VBA Code:
Public Sub Worksheet_Change(ByVal target As Range) MsgBox "The value changed in cell " & target.Address(0, 0) End Sub
⧪ Step 4: Saving the File as Excel Macro-Enabled Workbook
Next, save the file as Excel Macro-Enabled Workbook.

⧪ Step 5: The Output
Your worksheet is now ready to track. If you change the value of any cell in the worksheet, a message box will appear notifying you that the value in that cell has been changed.
Here I’ve changed the value in cell B4, and a message box is showing “The value changed in cell B4.”

Read More: How to See Who Made Changes in Excel
Things to Remember
Here I’ve used a message box to notify any change in the worksheet. But you notify it any other way, according to your wish. For example, you can call a Macro to run, or change the color of a particular cell, or anything.
Download Practice Workbook
Download this practice workbook to exercise while you are reading this article.
Track Cell Value Changes.xlsmConclusion
Therefore, this is the way to track if a cell value changes using VBA in Excel. Do you have any questions? Feel free to ask us.
Related Articles
- How to Check Edit History in Excel Online
- [Solved]: Track Changes Greyed Out in Excel
- [Solved]: Track Changes Not Showing in Excel
- How to Use Formula to Track Cell Changes in Excel
<< Go Back to Track Changes | Share Workbook | Workbook in Excel | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!Từ khóa » Visual Basic Excel Cell Value Change
-
VBA Cell Value - Get, Set, Or Change - Automate Excel
-
Run A Macro When Certain Cells Change In Excel - Office
-
VBA Enter Value In A Cell (Set, Get, And Change) - Excel Champs
-
How To Change A Cell Value With VBA - Techwalla
-
How To Change A Cell Value Using VBA In Microsoft Excel - Quora
-
Run A Macro When A Specific Cell Changes In Excel
-
How To Run Macro When Cell Value Changes In Excel? - ExtendOffice
-
Excel VBA Tutorial: Update Cell Value With VBA - YouTube
-
Excel VBA Change Cell Value, Double Loop, And Offset - YouTube
-
Worksheet Change Event - Excel Dashboards VBA
-
How Do I Get The Old Value Of A Changed Cell In Excel VBA?
-
How To Tell If A Cell Changed With VBA | Spreadsheets Made Easy
-
Macro When Excel Cell Changes - Excel Tips - MrExcel Publishing
-
Excel VBA: Change Cell Color Based On Value