Dear,
I am looking for the VBA coding when I click on a button the countdown starts. When I again click on this button the countdown should stop.
Every second should deduct 1 from the value. I do not want to make something with minutes and seconds. It just needs to go from 100 till 0.
I am not able to find this as all of the examples are in minutes and seconds.
This is what I have up so far
Sub TOP_SPELER1()
timerlength = Cells(3, "L").Value
Application.OnTime Now + TimeValue("00:00:01"), "nexttick"
End Sub
Sub looptimer()
Application.OnTime Now + TimeValue("00:00:01"), "nexttick"
End Sub
Sub nexttick()
If Cells(3, "L").Value <= 0 Then
Cells(3, "L").Value = 0
Exit Sub
End If
Cells(3, "L").Value = timerlength - 1
looptimer
End Sub
Can somebody please help me?
Thank you!
I am looking for the VBA coding when I click on a button the countdown starts. When I again click on this button the countdown should stop.
Every second should deduct 1 from the value. I do not want to make something with minutes and seconds. It just needs to go from 100 till 0.
I am not able to find this as all of the examples are in minutes and seconds.
This is what I have up so far
Sub TOP_SPELER1()
timerlength = Cells(3, "L").Value
Application.OnTime Now + TimeValue("00:00:01"), "nexttick"
End Sub
Sub looptimer()
Application.OnTime Now + TimeValue("00:00:01"), "nexttick"
End Sub
Sub nexttick()
If Cells(3, "L").Value <= 0 Then
Cells(3, "L").Value = 0
Exit Sub
End If
Cells(3, "L").Value = timerlength - 1
looptimer
End Sub
Can somebody please help me?
Thank you!