How could I modify the VBA and say that if the Range B1:B50 is less than or equal to Range A1:B50 then MsgBox......?????
- To post as a guest, your comment is unpublished.· 2 years agoGood Day,
Do you mean the total sum of range b1:b50?
Kutools for Excel is a powerful add-in that frees you from performing time-consuming operations in Excel, such as combine sheets quickly, merge cells without losing data, paste to only visible cells, count cells by color and so on. 300+ powerful features / functions for Excel 2019, 2016, 2013, 2010, 2007 or Office 365!
It enables tabbed browsing, editing, and managing of Microsoft Office applications. You can open multiple documents / files in a single tabbed window, such as using the browser IE 8/9/10, Firefox, and Google Chrome. It's compatible with Office 2019, 2016, 2013, 2010, 2007, 2003 or Office 365. Demo
Kutools for Outlook is a powerful add-in that frees you from time-consuming operations which majority of Outlook users has to perform daily! It can save your time from using Microsoft Outlook 2019, 2016, 2013, 2010 or Office 365!
Kutools for Word is a powerful add-in that frees you from time-consuming operations which majority of Word users have to perform daily! It can save your time from using Microsoft Word / Office 2019, 2016, 2013, 2010, 2007, 2003 or Office 365!
Restores the old look and menus of Office 2003 to Microsoft Office 2019, 2016, 2013, 2010, 2007 or Office 365. Don’t lose time in finding commands on the new Ribbon. Easy to deploy to all computers in enterprises and organizations.
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: