mirzao
Active member
Hi,
i have no idea why sometimes the function given me the wrong answer. When i put a msgbox at the first line of the function, it outputs 00:00:54 but the correct answer should be 00:05:04 and sometimes 00:00:00 becomes 00:00:10. Plz help. Thanks
i have no idea why sometimes the function given me the wrong answer. When i put a msgbox at the first line of the function, it outputs 00:00:54 but the correct answer should be 00:05:04 and sometimes 00:00:00 becomes 00:00:10. Plz help. Thanks
sub loop
sec=(sumidle(i)-1)*38
timecalc()
t=format(timecalc(),"00:00:00")
end sub
Private Function timeCalc() As Integer
MsgBox( min & sec)
If sec >= 60 And sec < 3600 Then
min = sec \ 60
sec = sec Mod 60
ElseIf sec >= 3600 Then
hr = sec \ 3600
min = sec Mod 3600
If min >= 60 And min < 3600 Then
min = min \ 60
sec = min Mod 60
End If
End If
timeCalc = hr& min & sec
End Function