Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Check the Date

I would like a VB code that will check the current date and then
perform an action. Something to the effect of:

SUB
IF today's date is after February 15, 2007 THEN
do this
ELSE
do that
END IF
END SUB

Is it possible?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Check the Date

Sub qwerty()
d = DateValue("2/15/2007")
MsgBox (d)
If Now() d Then
MsgBox ("after the date")
Else
MsgBox ("not there yet")
End If
End Sub
--
Gary''s Student
gsnu200703


"stewdizzle" wrote:

I would like a VB code that will check the current date and then
perform an action. Something to the effect of:

SUB
IF today's date is after February 15, 2007 THEN
do this
ELSE
do that
END IF
END SUB

Is it possible?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Check the Date


Sub ifdate()'where c5 has your desired date
If Date Range("c5") Then MsgBox "Hi"
End Sub
--
Don Guillett
SalesAid Software

"stewdizzle" wrote in message
ups.com...
I would like a VB code that will check the current date and then
perform an action. Something to the effect of:

SUB
IF today's date is after February 15, 2007 THEN
do this
ELSE
do that
END IF
END SUB

Is it possible?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Check the Date

That worked perfectly Gary's student...thanks


On Feb 4, 9:52 am, Gary''s Student
wrote:
Sub qwerty()
d = DateValue("2/15/2007")
MsgBox (d)
If Now() d Then
MsgBox ("after the date")
Else
MsgBox ("not there yet")
End If
End Sub
--
Gary''s Student
gsnu200703

"stewdizzle" wrote:
I would like a VB code that will check the current date and then
perform an action. Something to the effect of:


SUB
IF today's date is after February 15, 2007 THEN
do this
ELSE
do that
END IF
END SUB


Is it possible?



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
Date Check Aaron Excel Programming 1 November 16th 06 11:25 PM
Check date and act on it ladyhawke Excel Programming 6 August 28th 06 08:22 AM
Change text to date and check against date in cell RW Excel Programming 3 February 2nd 06 03:29 PM
Check for date Kjeldc Excel Programming 8 November 30th 05 03:21 AM
Check date Ben Excel Programming 2 December 21st 04 06:18 AM


All times are GMT +1. The time now is 11:15 PM.

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

About Us

"It's about Microsoft Excel"