In this article, we will demonstrate 3 examples of how to create a popup reminder in Excel. We’ll use the dataset below to illustrate our methods:
Example 1 – Popup Reminder for Due Dates
To set a due date reminder, we will use some Visual Basics for Applications (VBA) code that will pop up a reminder with the name of the Buyer if their Due Date has passed.
Steps:
- Select the active sheet from the Sheet Tab at the bottom of the worksheet and right-click on the sheet name.
- From the Context Menu, select View code.
- Enter the following code in the code window that opens:
Option Explicit
Sub DueDat()
Dim DueDatCol As Range
Dim DueD As Range
Dim PopUpNot As String
Set DueDatCol = Range("D5:D9")
For Each DueD In DueDatCol
If DueD <> "" And Date >= DueD - Range("D11") Then
PopUpNot = PopUpNot & " " & DueD.Offset(0, -2)
End If
Next DueD
If PopUpNot = "" Then
MsgBox "No buyer to chase today."
Else: MsgBox "Chase these buyers today: " & PopUpNot
End If
End Sub
- Click the Run button from the VBA window.
Running the code will take us to the worksheet and show the reminder with the names of the buyers with overdue dates.
- To test the code, change the due date of a buyer so that its overdue.
- Run the code again.
A new name will be added in the reminder popup notification.
Example 2 – Popup Reminder Based on Cell Value
Now let’s create a popup reminder when we select a cell with a specific numeric value. We’ll use the same dataset as in the first example above.
Steps:
- Right-click on the sheet name from the Sheet Tab at the bottom.
- Choose View code from the context menu.
- Enter the following code in the code window that opens:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim xCl As Range, Rng As Range
On Error Resume Next
Set Rng = Application.Intersect(Target, Range("C5:C9"))
If Not Rng Is Nothing Then
For Each xCl In Rng
If xCl.Value = "50000" Then
MsgBox "You selected cell " & xCl.Address, vbInformation, "Reminder in Excel"
Exit Sub
End If
Next
End If
End Sub
Private Sub Worksheet_selectionChange(ByVal Target As Range)
Dim xCl As Range, Rng As Range
On Error Resume Next
Set Rng = Application.Intersect(Target, Range("C5:C9"))
If Not Rng Is Nothing Then
For Each xCl In Rng
If xCl.Value = "50000" Then
MsgBox "You selected cell " & xCl.Address, vbInformation, "Reminder in Excel"
Exit Sub
End If
Next
End If
End Sub
- Go back to the worksheet and select random cells.
A popup reminder will appear when we select a cell having a value of 50000.
Read More: How to Create Notifications or Reminders in Excel
Example 3 – Popup Reminder as Alarm
We can also use VBA code to set a popup reminder as an alarm.
Steps:
- Open the worksheet in the location where you want the popup reminder as alarm.
- Press Alt + F11 to open the VBA window.
- From VBA Projects select the active sheet and right-click.
- Select Insert > Module.
- In the code window that appears, enter the following code:
Dim Alrm As Double
Dim Mesage As String
Sub PopupAlarmReminder()
Dim Whn As String
If Alrm = 0 Then
Whn = InputBox("What time would you like the reminder message to Popup?")
If Whn <> "" And Whn <> "False" Then
Mesage = InputBox("Please enter the reminder message")
On Error Resume Next
Alrm = Date + TimeValue(Whn)
On Error GoTo 0
Application.OnTime Alrm, " PopupReminder "
End If
Else
Beep
Application.Speech.Speak Mesage
MsgBox Mesage
Mesage = ""
Alrm = 0
End If
End Sub
- Click the Run button.
A Microsoft Excel window will pop up asking for a reminder time.
- Set a time and click OK.
A second window will appear.
- Enter the desired reminder message.
- Click OK.
- Wait for the alarm time.
An alarm with a popup reminder will appear at the time we set it.
Download Practice Workbook
Related Articles
- How to Generate Automatic Email Alerts in Excel
- How to Create Alerts in Excel
- How to Disable Alerts in Excel VBA
- How to Set Due Date Reminder Formula in Excel
<< Go Back to Alerts in Excel | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!