Private Sub Command1_Click() Dim a As Long Dim H, M, S As Integer H = 0 M = 0 S = 0 If a < 356400 Then If a \ 3600 > 0 Then H = a \ 3600 End If a = a - 3600 * H If a \ 60 Then M = a \ 60 End If S = a - M * 60 End If MsgBox TimeSerial(H, M, S) End Sub
手动算好了
除60。取
整数&':'&余数&':'&'00'
Dim a As Long
Dim H, M, S As Integer
H = 0
M = 0
S = 0
If a < 356400 Then
If a \ 3600 > 0 Then
H = a \ 3600
End If
a = a - 3600 * H
If a \ 60 Then
M = a \ 60
End If
S = a - M * 60
End If
MsgBox TimeSerial(H, M, S)
End Sub