.
Replace the macro code in mTimer with this:
Private Declare Function SetTimer Lib "User32" (ByVal hWnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Private Declare Function KillTimer Lib "User32" (ByVal hWnd As Long, ByVal nIDEvent As Long) As Long
Option Explicit
Dim TimerID As Long
Private Sub Chrono()
Dim T As Double, D As Long
D = CLng(UserForm1.LblDix.Caption) + 1
UserForm1.LblDix.Caption = Format(D, "00")
If (D Mod 100) = 0 Then
T = TimeValue(UserForm1.LblTemps.Caption) + TimeSerial(0, 0, 1)
With UserForm1
.LblTemps.Caption = Format(T, "hh:mm:ss")
.LblDix.Caption = "00"
'///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
'As an alternative you could try making a call to a separate Sub with the sound command/s, instead of placing the code here.
If UserForm1.LblTemps.Caption = "00:00:01" Then '<--- set the time for sound here
Beep '<-- place your command here for sound
End If
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
End With
End If
End Sub
Sub TimerOff()
KillTimer 0, TimerID
End Sub
Sub TimerOn(Interval As Long)
TimerID = SetTimer(0, 0, Interval, AddressOf Chrono)
End Sub
Bookmarks