Excel VBA Now Function
Excel VBA Now Function: The Now function in VBA returns the current date and time.
Syntax
Now ()
Parameter
NA
Return
This function returns the current date and time.
Example 1
Sub NowFunction_Example1() 'It will return the current date and time Dim date_val As String 'setting the date date_val = Now() ' The variable month_name will return the value "2/10/2020 22:45". Cells(1, 1).Value = date_val End Sub
Output
2/10/2020 22:45