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

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

Forum statistics

Threads
1,215,297
Messages
6,124,107
Members
449,142
Latest member
championbowler

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