VBA CDate Function: The CDate function in VBA converts an expression into a Date (or Time) data type.

Syntax

Parameter

Expression (required) – This parameter represents the expression that that you want to convert to a Date. It can hold both date and time information.

Return

This function returns an expression after converting it into Date. It returns the text representations of dates and times that are in a recognized Excel format.

Example 1

Output

12/01/2020

VBA CDate Function

Example 2

Output

3/11/2020

VBA CDate Function

Example 3

Output

1/4/1900

VBA CDate Function

Pin It on Pinterest

Share This