The VBA NOW function is listed under the time category of VBA functions. When you use it in a VBA code, it can return the current date and time in the result. It’s just like the NOW function in the worksheet.
Syntax
Now()
Arguments
- There’s no argument to specify in this function.
Example
To practically understand how to use VBA NOW function, you need to go through the below example where we have written a vba code by using it:
Sub example_NOW()
Range("A1").Value = Now()
End Sub
In the above code, we have used the NOW to get the current date and time in cell A1. Every time we run this code it gives us the exact current date and time according to system settings.
- Back to the Excel VBA / VBA Functions