tech on the net

MS Excel: NOW Function (WS, VBA)

In Microsoft Excel, the NOW function returns the current system date and time. This function will refresh the date/time value whenever the worksheet recalculates.

Syntax

The syntax for the NOW function is:

NOW()

Applies To

Type of Function

Worksheet Function Example

Let's take a look at an example to see how you would use the NOW function in a worksheet:

Microsoft Excel

The spreadsheet will continue to display this value, until the worksheet recalculates. By pressing the F9 key, you can force the worksheet to recalculate and the NOW function will update its value.

VBA Function Example

The NOW function can also be used in VBA code. For example:

Dim LValue As Date

LValue = Now

In this example, the variable called LValue would now contain the current system date and time.