Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default Compare current date to 2 dates

Hello,
How can I compare the current date to 2 other dates. Example:
fDate = Left$(Date$, 2) & Mid$(Date$, 4, 2) & Right$(Date$, 4)
I need a MsgBox to open if fDate is equal to or greater(=) than Nov. 1,
2004 AND equal to or less than(=<) Nov. 26, 2004.
Thank you for your help,
Terri
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Compare current date to 2 dates

Don't use strings.

Dim dt as Date
dt = Date ' todays date as an example.
if Dt DateSerial(2004,11,1) and Dt < DateSerial(2004,11,26) then

End if

--
Regards,
Tom Ogilvy

"Terri" wrote in message
...
Hello,
How can I compare the current date to 2 other dates. Example:
fDate = Left$(Date$, 2) & Mid$(Date$, 4, 2) & Right$(Date$, 4)
I need a MsgBox to open if fDate is equal to or greater(=) than Nov. 1,
2004 AND equal to or less than(=<) Nov. 26, 2004.
Thank you for your help,
Terri



Reply
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
MS Query - Filtering all dates greater than the current date BridgeBuilder Excel Discussion (Misc queries) 1 March 26th 10 08:58 PM
How do I get the most current date from a list of dates? GenaM Excel Discussion (Misc queries) 3 July 18th 06 03:25 PM
Compare date against multiple dates Struggling Excel Discussion (Misc queries) 1 April 26th 06 03:19 PM
How to make drop-down list of dates start with current date? Jan Buckley Excel Discussion (Misc queries) 15 August 29th 05 09:54 PM
Compare Current Date InnerChild[_2_] Excel Programming 1 July 13th 04 03:10 PM


All times are GMT +1. The time now is 12:53 PM.

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"