MsgBox if Range as date has passed

Rtkinnell

New Member
Joined
May 29, 2019
Messages
11
I am sure this has been answered before, therefore I apologize in advance. Can someone please assist me in a macro code under Worksheet_calculate to simply write.

If Range("N9") < Now() And Range("O9").value = False then
MsgBox "xxx xxx"
End If


It seems simple yet I can not come up with it correctly. It could even be written as if cell N9 is < cell B29. B29 being the current date on my sheet. Range O9 is a check box.
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Are you checking Range("09") for the word False? If so you need to put it in quotation marks.

If Range("N9") < Now() And Range("O9").value = "False" then
 
Upvote 0
No O9 is a checkbox, when unchecked value is false. But I will try this when I get back to conputer. Thank you for the response.
 
Upvote 0
could try something like this. range A1 on your form =TODAY()

Code:
Private Sub Workbook_Open()
Dim TDate As Date
TDate = Range("A1")
For Each Cell In Range("B2:B20")
    If Cell.Value < TDate - 10 And Cell.Value <> "" Then
            Cell.Interior.ColorIndex = 19
            Cell.Font.Bold = True
                If Cell.Value > TDate - 10 And Cell.Value <> "" Then
                    Cell.Interior.ColorIndex = 2
                    Cell.Font.Bold = False
                End If
    End If
Next
End Sub
 
Upvote 0
No O9 is a checkbox, when unchecked value is false. But I will try this when I get back to conputer. Thank you for the response.

A cell itself cannot be a checkbox. If you've inserted a check box form control then you need to refer to it specifically.
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

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