Thank you for Visiting my Blog

Tuesday, 29 August 2017

How DATE Function works in VBA


DATE Function
Date function returns a Variant (Date) containing the current system date.

Syntax
Date

Remarks
To set the system date, use the Date statement.

Date, and if the calendar is Gregorian, Date$ behavior is unchanged by the Calendar property setting. If the calendar is Hijri, Date$ returns a 10-character string of the form mm-dd-yyyy, where mm (01-12), dd (01-30) and yyyy (1400-1523) are the Hijri month, day and year. The equivalent Gregorian range is Jan 1, 1980 through Dec 31, 2099.

Example

Sub Date_fn()
Dim
TodayDate
TodayDate = Date    ' TodayDate contains the current system date.
MsgBox ("Today's Date: " & TodayDate)
End Sub

Output:


 

No comments:

Post a Comment