So I had previously posted asking for a code for a pop-up showing upcoming deadlines, but didn't get responses so I tried to come up with my own code. But now, I'm getting multiple pop-ups instead of just one.
I want 1 pop-up that shows the First, Last Name and DOL for each person whose "Statute" is 60 days or less away AND "Status" is Pre-lit. So the message will look like this:
UPCOMING STATUTES:
Jane Doe statute expiring in 20 days
Hotel Doe statute expiring in 59 days
Here is my code:
Here is my table:
Please help!
I want 1 pop-up that shows the First, Last Name and DOL for each person whose "Statute" is 60 days or less away AND "Status" is Pre-lit. So the message will look like this:
UPCOMING STATUTES:
Jane Doe statute expiring in 20 days
Hotel Doe statute expiring in 59 days
Here is my code:
VBA Code:
Private Sub Workbook_Open()
Dim bottomG As Integer
bottomD = Range("D" & Rows.Count).End(xlUp).Row
Dim c As Range
For Each c In Range("D2:D4000")
If c >= Date And c <= Date + 60 Then
MsgBox c.Offset(0, -2) & " " & c.Offset(0, -3) & " " & "DOL: " & c.Offset(0, -1) & " statute expiring in " & c - Date & " days."
End If
Next c
End Sub
Here is my table:
Please help!
Last edited by a moderator: