VBA TIME Function (Syntax + Example)

puneet-gogia-excel-champs

- Written by Puneet (Last Updated: June 22, 2023)

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:

example-vba-time-function
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.

Last Updated: June 22, 2023