TOP

VBA Function: Minute

Description

The VBA Minute function returns an integer that corresponds to the minute of the specified date or time.


Syntax Minute

Minute(date_hour)

VBA Minute Example

Using the Minute function to get the appropriate time information:

Sub MinuteExample1()
    
      myHour = #6:36:45PM#
    
      MsgBox Minute(myHour) 'Returns: 36

End Sub

Or by date and time (for the same result):

Sub MinuteExample2()
    
      myDate = #10/31/2020 6:36:45 PM#
    
      MsgBox Minute(myDate) 'Returns: 36

End Sub

This function also accepts dates and times in text format:

Sub MinuteExample3()
    
      myDate = "10/31/2020 18:36:45"
    
      MsgBox Minute(myDate) 'Returns: 36

End Sub
Function that returns the time of the current time: HOUR
Function that returns the seconds of the current time: SECOND