totn Excel Functions

MS Excel: How to use the NOW Function (WS, VBA)

This Excel tutorial explains how to use the Excel NOW function with syntax and examples.

Description

The Microsoft Excel NOW function returns the current system date and time.

The NOW function is a built-in function in Excel that is categorized as a Date/Time Function. It can be used as a worksheet function (WS) and a VBA function (VBA) in Excel. As a worksheet function, the NOW function can be entered as part of a formula in a cell of a worksheet. As a VBA function, you can use this function in macro code that is entered through the Microsoft Visual Basic Editor.

When used as a worksheet function, the NOW function will refresh the date/time value whenever the worksheet recalculates.

Syntax

The syntax for the NOW function in Microsoft Excel is:

NOW()

Parameters or Arguments

There are no parameters or arguments for the NOW function.

Returns

The NOW function returns a date value.

Applies To

  • Excel for Office 365, Excel 2019, Excel 2016, Excel 2013, Excel 2011 for Mac, Excel 2010, Excel 2007, Excel 2003, Excel XP, Excel 2000

Type of Function

  • Worksheet function (WS)
  • VBA function (VBA)

Example (as Worksheet Function)

Let's look at some Excel NOW function examples and explore how to use the NOW function as a worksheet function in Microsoft Excel:

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.

Example (as VBA Function)

The NOW function can also be used in VBA code in Microsoft Excel.

Let's look at some Excel NOW function examples and explore how to use the NOW function in Excel VBA code:

Dim LValue As Date

LValue = Now

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