close

Hi Guys,

Below is some code to start a stopwatch and run in Mins amp; Seconds I
would also like it to include hours as well.

Public Sub startClock()

Dim start
Range(quot;F6quot;).Select
start = Timer

Do While stopped = False
DoEvents
Worksheets(quot;Stopwquot;).Range(quot;F4quot;).Value = Int((Timer - start
0.5) / 60)
Worksheets(quot;Stopwquot;).Range(quot;H4quot;).Value = (Timer - start) Mod 60
Worksheets(quot;Stopwquot;).Range(quot;I4quot;).Value = (Timer - start 0.5) -
(Int(Timer - start 0.5))
Loop

End Sub--
Runner77
------------------------------------------------------------------------
Runner77's Profile: www.excelforum.com/member.php...oamp;userid=30388
View this thread: www.excelforum.com/showthread...hreadid=507113Hi Runner77,
Try...

Worksheets(quot;Stopwquot;).Range(quot;D4quot;).Value = Int((Timer - start 0.5) /
3600)
for hour in D4 since there are 3600 sec per hour.

Ken Johnson

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()