How to use the VBA ISDATE Function (Syntax + Example)

HomeVBA Functions LIST (Category Wise)How to use the VBA ISDATE Function (Syntax + Example)

The VBA ISDATE function is listed under the information category of VBA functions. When you use it in a VBA code, it evaluates the supplied expression and returns TRUE if it is date else FALSE. In simple words, it can check whether the value supplied is a date or not and returns TRUE or FALSE based on that.

Syntax

IsDate(Expression)

Arguments

  • Expression: An expression that you want to test if it’s a date or not.

Example

To practically understand how to use VBA ISDATE function, you need to go through the below example where we have written a vba code by using it:

Sub example_ISDATE()
Range("B1").Value = IsDate(Range("A1"))
End Sub

In the above code, we have used ISDATE to check if the value in cell A1 is a date or not and it has returned TRUE in the cell B1 as a result, we have TRUE as the value in cell A1 is a date.

Related Functions

ISARRAY | ISEMPTY | ISERROR | ISMISSING | ISNULL | ISNUMERIC | ISOBJECT