Display an Excel Pop-Up When a Formula Condition Is Met
Question details
Automatically display a pop-up when a formula signals that a price has reached an alert range.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A workbook uses formulas to flag prices that enter a specified range.
- Observed behavior
- The desired result is a pop-up when an alert condition is met, without repeated messages for the same alert.
Open the workbook in desktop Excel and identify the formula cells and empty cells you can use to track alerts. The example monitors S2:T100 for text beginning with “See” and uses U2:V100 for tracking, so adjust these ranges to match your workbook.
Use Worksheet_Calculate to show and track alerts
Use this VBA event when formula results should trigger pop-ups after the worksheet recalculates.
The example checks each cell in S2:T100. If its displayed value begins with “See,” it records “Warned” in the corresponding cell two columns to the right and displays a message. Change the condition if your formulas return a different alert text or numeric value.
In desktop Excel, open Developer > Visual Basic. In the Project pane, double-click the worksheet containing the alert formulas; add the code to that worksheet module, not a standard module.
Paste this code into the worksheet module, adjusting the range and condition as needed: Private Sub Worksheet_Calculate() Static busy As Boolean Dim cell As Range Dim statusCell As Range If busy Then Exit Sub busy = True On Error GoTo CleanUp For Each cell In Me.Range("S2:T100") Set statusCell = cell.Offset(0, 2) If Not IsError(cell.Value2) Then If LCase$(Left$(Trim$(CStr(cell.Value2)), 3)) = "see" Then If statusCell.Value2 <> "Warned" Then statusCell.Value2 = "Warned" MsgBox "Alert in " & cell.Address(False, False) & ": " & cell.Value2, vbExclamation, "Price alert" End If End If End If Next cell CleanUp: busy = False End Sub
Choose File > Save As and select Excel Macro-Enabled Workbook (*.xlsm). Reopen the file if needed and select Enable Content only if you trust the workbook and its macros.
Change an input that makes a monitored formula return text beginning with “See,” then recalculate the worksheet if necessary. Confirm that a pop-up appears and the matching cell in U or V contains “Warned.”
Clear the corresponding “Warned” cell in column U or V to allow another notification on a later recalculation. If the formula still meets the condition, it can alert again.

Work with price-tracking spreadsheets in WPS Office
WPS Office is a free, lightweight alternative with a familiar spreadsheet interface and Microsoft Office format compatibility, making it easy to move everyday spreadsheet work. Excel VBA event support can vary by WPS edition, so verify macro compatibility before relying on automatic pop-ups.

Frequently Asked Questions
Why doesn't the pop-up appear when my formula changes?
Check that the code is in the correct worksheet module under Developer > Visual Basic, that macros are enabled, and that the formula result matches the condition in the code. The example only checks S2:T100 for text beginning with “See.”
How can I alert on a numeric price range instead of text?
In the worksheet code, replace the text condition with a numeric comparison using your actual limits. For example, after checking that the value is numeric, test whether cell.Value2 is greater than or equal to the lower limit and less than or equal to the upper limit.
How do I stop the same alert from appearing repeatedly?
The example writes “Warned” in the corresponding tracking cell in U or V before showing the message. It skips that alert on later recalculations until you clear the tracking cell.
Can the alert run in Excel for the web or while the workbook is closed?
No. This VBA worksheet event requires the workbook to be open in desktop Excel with macros enabled; Excel for the web does not run VBA macros.




