ISDATE(expression)

Returns the value True or False depending if the expression is a date (Boolean).


expressionThe expression to test (Variant).

REMARKS
* This function refers to your local settings when determining what is a date and what isn't.
* The "expression" can be a date or a string in a date format.
* This function does recognise date and time literals.
* This function is used a lot to test if a text string can be converted to a date.
* You can use the ISARRAY function to return True or False depending if the value is an array.
* You can use the ISERROR function to return True or False depending if the value is an error.
* You can use the ISNULL function to return True or False depending if the value contains no data.
* You can use the ISNUMERIC function to return True or False depending if the value is a number.
* The equivalent .NET function is Microsoft.VisualBasic.Information.IsDate
* For the Microsoft documentation refer to docs.microsoft.com

Debug.Print IsDate("01/07/2003")   '= True  
Debug.Print IsDate("01/99") '= True
Debug.Print IsDate("01/13/2003") '= True
Debug.Print IsDate("13/01/2003") '= True
Debug.Print IsDate(Cdate(40544)) '= True
Debug.Print IsDate(40544) '= False
Debug.Print IsDate("1") '= False
Debug.Print IsDate(12) '= False
Debug.Print IsDate("12") '= False
Debug.Print IsDate("12-01-2012") '= False
Debug.Print IsDate("text") '= False

© 2021 Better Solutions Limited. All Rights Reserved. © 2021 Better Solutions Limited Top