Entering time values complete with colons is time consuming.
I am hoping to find a solution to this by being able to enter a four digit number (i.e. 6609) which will be converted to 66:09 in [mm]:ss format.
The times then can be used in calculations.
I have the following code which works well when converting four digits to [hh]:mm format, but I need to adapt it to [mm]:ss and can't figure it out...
Any pointers appreciated!
I am hoping to find a solution to this by being able to enter a four digit number (i.e. 6609) which will be converted to 66:09 in [mm]:ss format.
The times then can be used in calculations.
I have the following code which works well when converting four digits to [hh]:mm format, but I need to adapt it to [mm]:ss and can't figure it out...
Code:
With rCell
Dim Hrs As Integer
Dim Mins As Integer
'''convert the numeric value to a time value
Hrs= rCell.Value \ 100
Mins = rCell.Value Mod 100
rCell.Value = (Hrs + Mins / 60 / 24)
rCell.NumberFormat = "[hh]:mm"
End With
Last edited: