The VBA SECOND Function

Related Functions:
VBA Hour
VBA Minute

Description

The VBA Second Function returns the second component of a supplied time. The syntax of the function is:

Second( Time )

VBA Second Function Example

A simple example of the VBA Second function is shown below:

' Extract the second component from the time "17:56:33"
Const currTime = "17:56:33"
Dim secNum As Integer
secNum = Second(currTime)

After running the above snippet of VBA code, the variable secNum holds the value 33, which is the second component of the supplied time "17:56:33".