Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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... -----Original Message----- I have a macro that goes to a sheet and searches to find a certain group meeting. Then it moves over a few cells and grabs that meeting date. I want to know how I can take that date and make sure that the date is still in the future. Some of the old meeting dates are still on the sheet so, I want to go to the next meeting date if the first one found is already past. Thanks, David . |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Look up a value from a row after verifying two other values | Excel Worksheet Functions | |||
Verifying uniqueness of records in data | Excel Discussion (Misc queries) | |||
Verifying value of a cell | Excel Discussion (Misc queries) | |||
Verifying Email addresses etc using macros | Excel Discussion (Misc queries) | |||
Verifying Dates | Excel Worksheet Functions |