Function freformat(Inthhmmss As Double) As String
Dim Temp As String
Dim day As Integer
Dim Temphr As Integer
Dim Tempmm As Integer
Dim Tempss As Integer
Dim Temphhdd As Integer
day = Inthhmmss 'This gives you the number of days
Temp = Format$(Inthhmmss, "hh:mm:ss")
'This gives you the number of HH:MM:SS that are not part of a full day
Temphr = Left(Temp, 2) 'Returns number of hours
Tempmm = Mid(Temp, 4, 2) 'Returns number of mins
Tempss = Right(Temp, 2) 'Returns number of secs
Temphhdd = Temphr + (day * 24) 'This calculates total number of hours
'The below formats it so that is looks like hh:mm:ss
freformat = Format$(Temphhdd, "00") & ":" & Format$(Tempmm, "00") & ":" & Format$(Tempss, "00")
End Function