M
MacroMan
This should work for you (only fix the line breaks):
'Copy your date into a variable
xDateInQuestion = ActiveCell.FormulaR1C1
'Digitize your date
xDateInQuestion = DateSerial(Year(xDateInQuestion), _
Month(xDateInQuestion), Day(xDateInQuestion))
'Reformat it and compare it to today's date
If Format(xDateInQuestion, "YYYYMMDD") > _
Format(Date, "YYYYMMDD") Then
MsgBox "Future date " & xDateInQuestion
ElseIf Format(xDateInQuestion, "YYYYMMDD") = _
Format(Date, "YYYYMMDD") Then
MsgBox "Today " & xDateInQuestion
Else
MsgBox "Past date " & xDateInQuestion
End If
HTH...
'Copy your date into a variable
xDateInQuestion = ActiveCell.FormulaR1C1
'Digitize your date
xDateInQuestion = DateSerial(Year(xDateInQuestion), _
Month(xDateInQuestion), Day(xDateInQuestion))
'Reformat it and compare it to today's date
If Format(xDateInQuestion, "YYYYMMDD") > _
Format(Date, "YYYYMMDD") Then
MsgBox "Future date " & xDateInQuestion
ElseIf Format(xDateInQuestion, "YYYYMMDD") = _
Format(Date, "YYYYMMDD") Then
MsgBox "Today " & xDateInQuestion
Else
MsgBox "Past date " & xDateInQuestion
End If
HTH...