checking if date entered is older than 14 days

  • Thread starter Thread starter sup191
  • Start date Start date
S

sup191

How can I check to see if a date entered in cell O2 is older than 1
days? I'm sure it's a simple "if x < x-14 then" type thing, but
can't seem to figure out how to run a conditional on a date cell.
want a msgbox to pop up if the entered value is older.

Thanks
 
Hi
try something like
=IF(O2<TODAY()-14,"older than 14 days","newer")

or in the data validation dialog enter the formula
=O2>=TODAY()-14
 
if IsDate(Range("O2").Value) then
if Date - Range("O2").Value > 14 then
msgbox "too old"
End if
End if
 
That was fast!! :)

Thanks to both of you! I now have a couple ways to achieve my goal!



I love this forum... :cool:


Thanks again
 
If ActiveSheet.Range("O2").Value < Date - 14 Then
Debug.Print "too old"
End If

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top