DateSerial function

Category: Date & Time

Summary

Date from year, month, day.

Syntax

Returns a Variant (Date) for a specified year, month, and day.

Example

Example
This example uses the DateSerial function to return the date for the specified year, month, and day.
Dim MyDate
' MyDate contains the date for February 12, 1969.
MyDate = DateSerial(1969, 2, 12) ' Return a date.

Microsoft Support Page

https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/dateserial-function

Back to Functions