LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default verifying date

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Look up a value from a row after verifying two other values Paul W Excel Worksheet Functions 11 September 1st 08 08:59 PM
Verifying uniqueness of records in data arad Excel Discussion (Misc queries) 4 June 25th 07 05:50 PM
Verifying value of a cell El Criollo Excel Discussion (Misc queries) 7 December 12th 06 10:21 AM
Verifying Email addresses etc using macros [email protected] Excel Discussion (Misc queries) 0 February 13th 06 07:25 PM
Verifying Dates gilbert Excel Worksheet Functions 1 September 8th 05 03:22 AM


All times are GMT +1. The time now is 11:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"