The VBA Minute function returns an integer that corresponds to the minute of the specified date or time.
Minute(date_hour)
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