• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Help with Reset Button

pandoram316

New Member
Hello,

I am trying to create a reset button for a countdown timer.

Can someone help me with a macro for a command button. I am also trying to have the stop timer button time stamp the time that the clock was stopped at on cell J5 (I got that far) and have it continue putting the next new stop time in cell J6 and so on. I just can't figure out how to have it do that.

Here is the macro I have for the starttimer, stoptimer, part.

Thank you
Code:
Sub starttimer()
Application.OnTime Now + TimeValue("00:00:01"), "nexttick"
End Sub

Sub nexttick()
If Sheet1.Range("C1") = 0 Then Exit Sub
Sheet1.Range("C1").Value = Sheet1.Range("C1").Value - TimeValue("00:00:01")
If Sheet1.Range("C1").Value <= TimeValue("00:21:00") Then
Sheet1.Shapes("TextBox 1").Fill.ForeColor.RGB = RGB(255, 0, 0)
Else
Sheet1.Shapes("TextBox 1").Fill.ForeColor.RGB = RGB(0, 255, 0)
End If
starttimer
End Sub

Sub stoptimer()
x = 1
On Error Resume Next
Application.OnTime Now + TimeValue("00:00:01"), "nexttick", , False
For Each tbox In ActiveSheet.TextBoxes
Range("j" & x).Value = tbox.Text
x = x + 2
Next tbox

End Sub
 
Last edited by a moderator:
Back
Top