Thread: IsDate
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default IsDate

Hi Apil27,

Copied direct from VBA help

'===================:

IsDate Function

Returns a Boolean value indicating whether an expression can be converted to
a date.

Syntax

IsDate(expression)

The required expression argument is a Variant containing a date expression
or string expression recognizable as a date or time.

Remarks

IsDate returns True if the expression is a date or is recognizable as a
valid date; otherwise, it returns False. In Microsoft Windows, the range of
valid dates is January 1, 100 A.D. through December 31, 9999 A.D.; the
ranges vary among operating systems.


IsDate Function Example
This example uses the IsDate function to determine if an expression can be
converted to a date.

Dim MyDate, YourDate, NoDate, MyCheck
MyDate = "February 12, 1969": YourDate = #2/12/69#: NoDate = "Hello"
MyCheck = IsDate(MyDate) ' Returns True.
MyCheck = IsDate(YourDate) ' Returns True.
MyCheck = IsDate(NoDate) ' Returns False.

'<<===================


---
Regards,
Norman



"april27" wrote in message
...
I am writing a macro for an Excel spreadsheet. in a user form i have a text
field. in this field the user shall enter a date. the program shall then
revise the date and return an error message if it is not a date. I try to
use
the IsDate function but i dont know how to use it and my help menu does
not
give me any info on this. anyone?