Excel Chronometer (Stopwatch)

Excel Chronometer Example


         A nice Excel chronometer userform.
The stopwatch is running on the userform.The stopwatch can be stopped and value in screen can be saved.


VBA codes of chronometer "Start" button :
Option Explicit
Dim Durrrrr As Boolean
Dim Etime As Single
Dim Etime0 As Single
Dim Sonzaman As Single
Dim tur As Integer

Private Sub CommandButton1_Click()
Durrrrr = False
Etime0 = Timer() - Sonzaman
Me.Repaint
Do Until Durrrrr
Etime = Int((Timer() - Etime0) * 100) / 100
If Etime > Sonzaman Then
Sonzaman = Etime
ElapsedTimeLbl.Caption = Format(Etime / 86400, "hh:mm:ss.") & Format(Etime * 100 Mod 100, "00")
DoEvents
End If
Loop
End Sub

1 comment: