Last Updated on January 11, 2023 by token
1. Now VBA function – Description
The Now VBA function returns the current date and time or the time only. If we want Excel VBA to return the current date, we should use this function. The Date function has no arguments. The time value from the Now function is the system time. You can compare the function to the NOW () formula in an Excel worksheet. If, in turn, we would like VB to return only the current date, we should use the Date () function, which you can read about in this article: VBA Date .
2. VBA Now function – Syntax
Function return: Date / System date and time or system time.
3. VBA Now function – Example
How to use the Now function in VBA Excel? Below is an example of using the Now function in the VisualBasic Editor.
Dim TimeExample As Date TimeExample = Now MsgBox TimeExample
Range ("A1") = Now
4. VB Now feature – Additional information
5. Now VisualBasic function – Where to use?
The function can be used in: Excel 2003, Excel 2007, Excel 2010, Excel 2013, Excel 2016, Excel 2019, Excel 2021, Excel 365.
The article is part of the VBA Excel function list. You can find a list of all VBA functions at this address: VBA functions .