Hello all!
I have worked for 2 days on this issue and I am barely half way there.
Untitled.jpg
The time is the counting down total time allowed for all phases of the activity. I need it to start on open and only have a stop/pause button. I also need the Target Time cells to count down once the main timer starts. So when the file is opened, the overall countdown begins then cell C2 will countdown to 0 and stop, the cell C4 will countdown to 0 then stop and so on.
Here is my main timer code:
Sub starttimer()
Application.OnTime Now + TimeValue("00:00:01"), "nexttick"
End Sub
Sub nexttick()
If Sheet1.Range("S1") = 0 Then Exit Sub
Sheet1.Range("S1").Value = Sheet1.Range("S1").Value - TimeValue("00:00:01")
'~~> Multiple-line syntax:
If Sheet1.Range("S1").Value <= TimeValue("08:05:00") Then Sheet1.Shapes("TextBox 1").Fill.ForeColor.RGB = RGB(253, 250, 132)
If Sheet1.Range("S1").Value <= TimeValue("07:20:00") Then Sheet1.Shapes("TextBox 1").Fill.ForeColor.RGB = RGB(102, 255, 255)
If Sheet1.Range("S1").Value <= TimeValue("04:40:00") Then Sheet1.Shapes("TextBox 1").Fill.ForeColor.RGB = RGB(255, 153, 255)
If Sheet1.Range("S1").Value <= TimeValue("03:40:00") Then Sheet1.Shapes("TextBox 1").Fill.ForeColor.RGB = RGB(51, 153, 255)
If Sheet1.Range("S1").Value <= TimeValue("01:00:00") Then Sheet1.Shapes("TextBox 1").Fill.ForeColor.RGB = RGB(196, 189, 151)
starttimer
End Sub
Sub stoptimer()
On Error Resume Next
Application.OnTime Now + TimeValue("00:00:01"), "nexttick", , False
End Sub
Is this at all possible!?
Bookmarks