The VBA TIMER function is listed under the time category of VBA functions. When you use it in a VBA code, it returns the number of seconds that have elapsed since midnight of the current day. In simple words, it returns the number of seconds elapsed passed from 12:00 AM of the current day.
Syntax
Timer()
Arguments
- There’s no argument to specify in this function.
Example
To practically understand how to use the VBA TIMER function, you need to go through the below example where we have written a vba code by using it:
Sub example_TIMER()
Range("A1").Value = Timer()
End Sub
In the above code, we have used TIMER to get the total seconds that have elapsed since midnight today.
More Tutorials
⇠ Back to VBA Function List | What is VBA in Excel
Helpful Links – Developer Tab – Visual Basic Editor – Run a Macro – Personal Macro Workbook – Excel Macro Recorder – VBA Interview Questions – VBA Codes