Show current date and time

To show the current date and time you can apply the Excel NOW Function

Example: Show current date and time

Show current date and time

METHOD 1. Show current date

EXCEL

=NOW()
The formula uses the Excel NOW function to return the current date and time.

METHOD 1. Show current date and time using VBA

VBA

Sub Show_current_date_and_time()
'declare a variable
Dim ws As Worksheet
Set ws = Worksheets("Analysis")

'apply formula to calculate the current date and time
ws.Range("B5") = Now

End Sub

OBJECTS
Worksheets: The Worksheets object represents all of the worksheets in a workbook, excluding chart sheets.
Range: The Range object is a representation of a single cell or a range of cells in a worksheet.
PREREQUISITES
Worksheet Name: Have a worksheet named Analysis.

ADJUSTABLE PARAMETERS
Output Range: Select the output range by changing the cell reference ("B5") in the VBA code to any cell in the worksheet, that doesn't conflict with formula.

Explanation about the formula used to show current date and time

EXPLANATION

EXPLANATION
To show the current date and time you can apply the Excel NOW Function.
FORMULA
=NOW()
ARGUMENTS
The Excel NOW Function does not accept any arguments.

ADDITIONAL NOTES
Note 1: The Excel NOW Function does not accept any arguments.
Note 2: Each time the worksheet is recalculated or opened the current date and time will be updated.