Timers in excel

David S

New Member
Joined
Apr 19, 2013
Messages
2
Hi all. Hope you can help. I have never been trained on VBA and am trying to create a countdown timer. I have acheived that however the timer is needed on 15 different tabs, which represent 15 different trials and therefore needs to be specific to that tab.

At the moment if I am on any particular test the timer works fine, however if I move off that tab the timer stops on the original tab and starts on the current tab. I need to be able to move about tabs with the active test timer still running and the non active test timers static. The timer is a countdown with the start time dictated by a "sample time" column as the sample time may be changed during the trial. So I have used if statements to look up the column from the bottom to determine the sample time for that particular phase of the trial. The code I currently have in Module 1 is

Sub Countup()
Dim CountDown As Date
CountDown = Now + TimeValue("00:00:01")
Application.OnTime CountDown, "Realcount"
End Sub

Sub Realcount()
Dim count As Range
Set count = [t13]
count.Value = count.Value - TimeSerial(0, 0, 1)
If count <= 0 Then
Beep
MsgBox "WEIGH THE TRAY"
Exit Sub
End If
Call Countup
End Sub


I also have a timer override in the timer, so that if we have to stop part way through a specific time period I can overwrite to allow for remaining time, and then I can reset that to look back at the sample time column for the next phase of the trial
Is there any way to have this code specific to a particular sheet, e.g. Test 1, Test 2 etc


I tried to insert an image to show what the timer buttons look like in the sheet, but am not sure how to do that on here.

I also realise that I could just download a timer app, but you know how it is, you get into something like this and are close to the end result and cannot let it beat you :)

Thanks

David
 

Some videos you may like

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Watch MrExcel Video

Forum statistics

Threads
1,122,517
Messages
5,596,619
Members
414,081
Latest member
Subaru_Steve

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top