Show current date
To show the current date you can apply the Excel TODAY Function
Example: Show current date
Sub Show_current_date()
'declare a variable
Dim ws As Worksheet
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'apply formula to calculate the current date
ws.Range("B5") = Date
ws.Range("B5") = Date
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.
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.
Worksheet Name: Have a worksheet named Analysis.
ADJUSTABLE PARAMETERS
Output Range: Select the output range by changing the range reference ("B5") in the VBA code to any cell in the worksheet, that doesn't conflict with formula.
EXPLANATION
To show the current date you can apply the Excel TODAY Function.
To show the current date you can apply the Excel TODAY Function.
FORMULA
=TODAY()
=TODAY()
ARGUMENTS
The Excel TODAY Function does not accept any arguments.
The Excel TODAY Function does not accept any arguments.
ADDITIONAL NOTES
Note 1: The Excel TODAY Function does not accept any arguments.
Note 2: Each time the worksheet is recalculated or opened the current date will be updated.