How to pop up message box if cell value changes within a range in Excel?
Sometimes you need to remind yourself of the changes within a range in a certain worksheet. So a pop up message box will do you a favor if cell value has changed in a certain range. You can achieve it with a VBA method in this article.
The following VBA code will pop up a message box if cell value changes within a specified range of a certain worksheet. Please do as follows.
1. Press Alt + F11 keys simultaneously to open the Microsoft Visual Basic for Applications window.
2. In the Microsoft Visual Basic for Applications window, double click the sheet name (the specified range exists in) in the left bar to open its Code window, then copy and paste the below VBA code into the window.
VBA code: pop up message box if cell value changes within a range
Private Sub Worksheet_Change(ByVal Target As Range) If Not (Application.Intersect(Range("A1:E19"), Target) Is Nothing) Then MsgBox "Cell " & Target.Address & " has changed.", vbInformation, "Kutools for Excel" End If End Sub
Note: you can change the specified range A1:E19 in the code to the range you need.
3. Press Alt + Q keys at the same time to close the Microsoft Visual Basic for Applications window.
For now on, when cell values in range A1:E19 changed, a message box will pop up automatically. See screenshot:
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!