The VBA MINUTE Function

Related Functions:
VBA Hour
VBA Second

Description

The VBA Minute Function returns the minute component of a supplied time. The syntax of the function is:

Minute( Time )

VBA Minute Function Example

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

' Extract the minute component from the time "17:56:33"
Const currTime = "17:56:33"
Dim minNum As Integer
minNum = Minute(currTime)
' The variable minNum is now equal to 56.

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


VBA Minute Function Error

If the VBA Minute function is supplied with a value that cannot be interpreted as a valid time, it will return the error:

Run-time error '13': Type mismatch

VBA Run Time Error 13 Message Box