#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Countdown Timer

I created a spreadsheet to score my daughter's basketball games. I need to
create a"Game Clock" macro that I can set the amount of time at the start of
each period(minutes, seconds, tenths of seconds if possible) and have it
count down until the time has expired. I also need to stop and start the
timer with a button.

Can anyone help???
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Countdown Timer

Hi,

I'm not sure about 10th seconds but here's one for H:M:S

Format A1 as HH:MM:SS and enter a duration as a time. make it nice and big.
I merged a bunch of cells and set the font to 48 point.

Alt+f11 to open VB editor and right click 'This Workbook' and insert module
and paste the code below in

Put a button on your sheet to run the TIMER sub and the clock counts down.
At any time enter a t in d1 and the clock pauses. delete the T and the clock
resumes. the sheet with the clock must remain the active sheet

Sub Timer()
CountDown = Now + TimeValue("00:00:01")
Application.OnTime CountDown, "GoClock"
End Sub
Sub GoClock()
Dim count As Range
Set count = [A1] ' Enter time in seconds
If UCase(Range("D1")) = "T" Then
count.Value = count.Value
Else
count.Value = count.Value - TimeValue("00:00:01")
End If
If count <= 0 Then
MsgBox "Game Over"
Exit Sub
End If
Call Timer
End Sub


Mike






"Robert_NSBG" wrote:

I created a spreadsheet to score my daughter's basketball games. I need to
create a"Game Clock" macro that I can set the amount of time at the start of
each period(minutes, seconds, tenths of seconds if possible) and have it
count down until the time has expired. I also need to stop and start the
timer with a button.

Can anyone help???

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Countdown timer Ira Excel Discussion (Misc queries) 7 November 16th 07 01:50 AM
Countdown Timer Saxman Excel Discussion (Misc queries) 1 February 6th 07 09:55 AM
HELP for COUNTDOWN TIMER CC Excel Discussion (Misc queries) 3 May 8th 06 12:44 PM
Is a countdown timer possible? aharmer Excel Discussion (Misc queries) 1 February 8th 05 01:47 AM
Display a countdown timer HAL Excel Worksheet Functions 3 November 12th 04 07:03 PM


All times are GMT +1. The time now is 12:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"