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
- Aug 28 Tue 2007 20:38
VBA Code Help
close
全站熱搜
留言列表
發表留言