Working With Date Data Type in Excel

By Hemanta Sundaray on 2021-09-03

In VBA, we have a data type named Date.

A variable defined as a Date can hold dates ranging from January 1, 0100, to December 31, 9999.

We place dates between two hash (#) marks.

Example:

Sub ShowMonth()

Dim Birthday As Date

Birthday = #4/26/1987#

MsgBox MonthName(Month(Birthday))

End Sub

Output:

Month Name

Join the Newsletter