VBA Now Function – Get Current Date & Time

Now Description

Returns the current system date and time.

Simple Now Examples

Here is a simple Now example:

Sub Now_Example()
    MsgBox Now
End Sub

This code will return the current system date and time.

Now Syntax

In the VBA Editor, the syntax for the Now function.

Now

The Now function contains no arguments:

Examples of Excel VBA Now Function

Dim CurrentDateTime As Date
CurrentDateTime = Now

In this example, the variable “CurrentDateTime” would contain the current system date and time.