What is the syntax of Time Function in VBA?

The Time Function returns the current system time.

Syntax

Time()

Example

Private Sub Constant_demo_Click() 
msgbox("Line 1: " & Time()) 
End Sub

When you execute the above function, it produces the following output.

Line 1: 3:29:15 PM