VBA Show 2 pop up messages based on cell dates

floggingmolly

Board Regular
Joined
Sep 14, 2019
Messages
167
Office Version
  1. 365
Platform
  1. Windows
I have a code that gives a pop up message when a certain day is reached in a cell. I am trying to figure out how to do 2 messages based on 2 different dates. For example if the date in cell BD1 is within 5 days of today I have a pop up alerting that a date in my range B:B is within 5 days. Then I want to have a date in cell BE1 that is 3 days from today and a pop up alerting that a date in my range is now within 3 days. Below is the code I am using. It works when a date in range B:B is within 5 days but I am trying to make it so it will give another message if any date in B:B is within 3 days. I hope this makes sense.

Code:
Sub Workbook_open()
Dim r As Long

    For r = 2 To 100
        If Range("BD1").Value = Range("BB" & r).Value Then
            MsgBox "THERE ARE NON-RENEWALS THAT NEED NOTIFIED WITHIN 5 DAYS!!!!"
        
    Exit Sub
        End If
    Next r
    
End Sub
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,214,584
Messages
6,120,384
Members
448,956
Latest member
JPav

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top