count down clock

tintin1012000

Board Regular
Joined
Apr 27, 2011
Messages
237
I want to put a count down clock in MM:SS format into Cell c4 that will count down from 02:00 to zero once the workbook is open, I have a auto save and close working and nwo i want a clock to tell the user how long before the sheet closes

Thanks
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
You need something like this

<font face=Courier New><SPAN style="color:#00007F">Dim</SPAN> CountDown <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Date</SPAN><br><SPAN style="color:#00007F">Sub</SPAN> Timer()<br>CountDown = Now + TimeValue("00:00:01")<br>Application.OnTime CountDown, "Reset"<br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br><SPAN style="color:#00007F">Sub</SPAN> Reset()<br><SPAN style="color:#00007F">Dim</SPAN> count <SPAN style="color:#00007F">As</SPAN> Range<br><SPAN style="color:#00007F">Set</SPAN> count = [A1] <SPAN style="color:#007F00">' A1 contains the number of seconds for the countdown.</SPAN><br>count.Value = count.Value - 1<br><SPAN style="color:#00007F">If</SPAN> count <= 0 <SPAN style="color:#00007F">Then</SPAN><br>MsgBox "Countdown complete."<br><SPAN style="color:#00007F">Exit</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br><SPAN style="color:#00007F">Call</SPAN> Timer<br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br><SPAN style="color:#00007F">Sub</SPAN> DisableTimer()<br><SPAN style="color:#00007F">On</SPAN> <SPAN style="color:#00007F">Error</SPAN> <SPAN style="color:#00007F">Resume</SPAN> <SPAN style="color:#00007F">Next</SPAN><br>Application.OnTime EarliestTime:=CountDown, Procedure:="Reset", Schedule:=<SPAN style="color:#00007F">False</SPAN><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br></FONT>
 
Upvote 0
I had tried this code already from another forum but its not what i need, I want cell c4 to count down as soon at the sheet is open
 
Upvote 0
The code works you have to change some elements to the Workbook events for On Open.

Im a little confused as you first say workbook now you are saying sheet, please clarify and which sheet should be selected when the workbook opens to show the 2 minutes first.
 
Upvote 0

Forum statistics

Threads
1,224,607
Messages
6,179,871
Members
452,949
Latest member
Dupuhini

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
Back
Top