game timer

P

pat67

I had asked this before and don't know what i did with the repsonses
so here goes. I need a timer that works like the clock at a sporting
event. Counts down to zero. Thanks
 
F

FSt1

I had asked this before and don't know what i did with the repsonses
so here goes. I need a timer that works like the clock at a sporting
event. Counts down to zero. Thanks

hi
see this site.....

http://www.mvps.org/dmcritchie/excel/datetime.htm

it a large site, all about excel and date/time. scroll down towards
the bottom. there are several timers there. one might suit your needs.
you might also do a google on excel timers. there is a lot of info out
there on this subject.

Regards
FSt1
 
P

pat67

hi
see this site.....

http://www.mvps.org/dmcritchie/excel/datetime.htm

it a large site, all about excel and date/time. scroll down towards
the bottom. there are several timers there. one might suit your needs.
you might also do a google on excel timers. there is a lot of info out
there on this subject.

Regards
FSt1

Thanks. i actually found what I had before. which is this

Sub Timer()
CountDown = Now + TimeValue("00:00:01")
Application.OnTime CountDown, "Reset"
End Sub

Sub Reset()
Dim count As Range
Set count = [Main!B1] 'B1 contains the number of seconds for the
countdown.
count.Value = count.Value - 1
If count <= 0 Then
MsgBox "Level Complete."
Exit Sub
End If
Call Timer
End Sub


Kind of convoluted but works when inputting seconds.What i am looking
for now is a way to stop the timer and also to have an input box reset
the value in Main!B1

Any ideas?
 
P

pat67

hi
see this site.....

it a large site, all about excel and date/time. scroll down towards
the bottom. there are several timers there. one might suit your needs.
you might also do a google on excel timers. there is a lot of info out
there on this subject.
Regards
FSt1

Thanks. i actually found what I had before. which is this

Sub Timer()
CountDown = Now + TimeValue("00:00:01")
Application.OnTime CountDown, "Reset"
End Sub

Sub Reset()
Dim count As Range
Set count = [Main!B1] 'B1 contains the number of seconds for the
countdown.
count.Value = count.Value - 1
If count <= 0 Then
MsgBox "Level Complete."
Exit Sub
End If
Call Timer
End Sub

Kind of convoluted but works when inputting seconds.What i am looking
for now is a way to stop the timer and also to have an input box reset
the value in Main!B1

Any ideas?- Hide quoted text -

- Show quoted text -

All I need now is how to stop the timer in this code. I have this

Sub DisableTimer()
On Error Resume Next
Application.OnTime EarliestTime:=CountDown, Procedure:="Reset",
Schedule:=False
End Sub

Unfortunately it is not working so I have no idea. Any help would be
greatly appreciated.

Thanks in advance
 
F

FSt1

Thanks. i actually found what I had before. which is this
Sub Timer()
CountDown = Now + TimeValue("00:00:01")
Application.OnTime CountDown, "Reset"
End Sub
Sub Reset()
Dim count As Range
Set count = [Main!B1] 'B1 contains the number of seconds for the
countdown.
count.Value = count.Value - 1
If count <= 0 Then
MsgBox "Level Complete."
Exit Sub
End If
Call Timer
End Sub
Kind of convoluted but works when inputting seconds.What i am looking
for now is a way to stop the timer and also to have an input box reset
the value in Main!B1
Any ideas?- Hide quoted text -
- Show quoted text -

All I need now is how to stop the timer in this code. I have this

Sub DisableTimer()
On Error Resume Next
Application.OnTime EarliestTime:=CountDown, Procedure:="Reset",
Schedule:=False
End Sub

Unfortunately it is not working so I have no idea. Any help would be
greatly appreciated.

Thanks in advance

hi again.
i added two command button.....Start and Stop
i also modified your code a tad.
add a public call stopit as boolean. see code.
my buttons...commandbutton1 = start, commandbutton2 = stop
Private Sub CommandButton1_Click()
stopit = True
Call Timer
End Sub

Private Sub CommandButton2_Click()
stopit = False
'DoEvents
End Sub
your modified code.....
Public stopit As Boolean
Sub Timer()
countdown = Now + TimeValue("00:00:01")
Application.OnTime countdown, "Reset"
End Sub

Sub Reset()
Dim count As Range
Dim i As Long
Set count = [Sheet1!B2] 'B1 contains the number of seconds for the
countdown.
count.Value = count.Value - 1
'DoEvents
If stopit = False Then Exit Sub
If count <= 0 Then
MsgBox "Level Complete."
Exit Sub
End If
stopit = True
Call Timer
End Sub

crude but tested and works.

regards
FSt1
 
F

FSt1

I had asked this before and don't know what i did with the repsonses
so here goes. I need a timer that works like the clock at a sporting
event. Counts down to zero. Thanks
hi
see this site.....
http://www.mvps.org/dmcritchie/excel/datetime.htm
it a large site, all about excel and date/time. scroll down towards
the bottom. there are several timers there. one might suit your needs.
you might also do a google on excel timers. there is a lot of info out
there on this subject.
Regards
FSt1
Thanks. i actually found what I had before. which is this
Sub Timer()
CountDown = Now + TimeValue("00:00:01")
Application.OnTime CountDown, "Reset"
End Sub
Sub Reset()
Dim count As Range
Set count = [Main!B1] 'B1 contains the number of seconds for the
countdown.
count.Value = count.Value - 1
If count <= 0 Then
MsgBox "Level Complete."
Exit Sub
End If
Call Timer
End Sub
Kind of convoluted but works when inputting seconds.What i am looking
for now is a way to stop the timer and also to have an input box reset
the value in Main!B1
Any ideas?- Hide quoted text -
- Show quoted text -
All I need now is how to stop the timer in this code. I have this
Sub DisableTimer()
On Error Resume Next
Application.OnTime EarliestTime:=CountDown, Procedure:="Reset",
Schedule:=False
End Sub
Unfortunately it is not working so I have no idea. Any help would be
greatly appreciated.
Thanks in advance

hi again.
i added two command button.....Start and Stop
i also modified your code a tad.
add a public call stopit as boolean. see code.
my buttons...commandbutton1 = start, commandbutton2 = stop
Private Sub CommandButton1_Click()
stopit = True
Call Timer
End Sub

Private Sub CommandButton2_Click()
stopit = False
'DoEvents
End Sub
your modified code.....
Public stopit As Boolean
Sub Timer()
countdown = Now + TimeValue("00:00:01")
Application.OnTime countdown, "Reset"
End Sub

Sub Reset()
Dim count As Range
Dim i As Long
Set count = [Sheet1!B2] 'B1 contains the number of seconds for the
countdown.
count.Value = count.Value - 1
'DoEvents
If stopit = False Then Exit Sub
If count <= 0 Then
    MsgBox "Level Complete."
    Exit Sub
End If
stopit = True
Call Timer
End Sub

crude but tested and works.

regards
FSt1

oop. posted too soon. i moved a line of code which makes it more
responsive.
Sub Reset()
Dim count As Range
Dim i As Long
Set count = [Sheet1!B2] 'B1 contains the number of seconds for the
countdown.
If stopit = False Then Exit Sub
count.Value = count.Value - 1
If count <= 0 Then
MsgBox "Level Complete."
Exit Sub
End If
stopit = True
Call Timer
End Sub

regards
FSt1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top