VBA - Time Function



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 
vba_date_time.htm
Advertisements