VBA TIME Function (Syntax + Example)

The VBA TIME function is listed under the time category of VBA functions. When you use it in a VBA code, it returns the current time in the result. This current time will be according to the system’s current time.

Syntax

Time()

Arguments

  • There’s no argument to specify in this function.

Example

To practically understand how to use the VBA TIME function, you need to go through the below example where we have written a vba code by using it:

Sub example_TIME()
Range("A1").Value = Time()    
End Sub

In the above code, we have used TIME to get the current time in cell A1.

Related Functions

HOUR | MINUTE | NOW | SECOND | TIMER | TIMESERIAL | TIMEVALUE