VBA DATE Function

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

What is VBA DATE Function

how to use it

To use VBA's DATE function you need to understand its syntax and arguments:

Syntax

Date()

Arguments

  • There’s no argument to define within the function.

Example to use DATE Function in VBA

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

Sub example_DATE()
Range("A1").Value = Date
End Sub

In the above example, we have used the DATE function to enter the current date into the cell A1.

Unlike the TODAY function, (which you can use in the worksheet) the date entered by the VBA DATE function is not volatile, so if you want to enter the current date again you need to run the code again.

Related Functions

About the Author

puneet one point one

Puneet is using Excel since his college days. He helped thousands of people to understand the power of the spreadsheets and learn Microsoft Excel. You can find him online, tweeting about Excel, on a running track, or sometimes hiking up a mountain.