Spyder1000
Technical User
I’ve got a list of times in seconds. Now I know I can just device it by 60 to convert it to Minutes and the Decimal version of seconds. But I’d rather be able to display the time in Minutes:Seconds. Any suggestions?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Debug.print 123 / 60
2.05
Debug.print 123 \ 60
2
Debug.print 123 mod 60
3
Sub TimeFormattingTest()
Dim intTotalSeconds As Integer
Dim intSeconds As Integer
Dim intMinutes As Integer
Dim strMyTime As String
intTotalSeconds = 123
intSeconds = intTotalSeconds Mod 60
intMinutes = intTotalSeconds \ 60
strMyTime = Format$(intMinutes, "00") & ":" & Format$(intSeconds, "00")
MsgBox strMyTime
End Sub