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.

AutoMacro - VBA Code Generator

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.

VBA Code Examples Add-in

Easily access all of the code examples found on our site.

Simply navigate to the menu, click, and the code will be inserted directly into your module. .xlam add-in.

(No installation required!)