Ok, below is a little code I wrote a while back when I was doing something
similar. I'll email it to you if you have difficulties setting the PPT up.
Feel free to use it for your project, but, when you talk to the students,
include a word of thanks for the newsgroup and the help it provides
Thanks,
B
============================
Objects on slide:
3 command buttons labeled ...
cmd1 -- kind large at bottom of slide
cmd2 -- very large in center of slide
cmd3 -- rather small in lower corner -- caption to read "Exit Timer"
-=-=-=-=-=-=-=-
Code as Follows:
-=-=-=-=-=-=-=-
Option Explicit
Public EndTime As Double
Public StopIt As Boolean
Private Sub cmd1_Click()
'Set up variable
Dim Dummy As String
'Determine running state and change
Select Case cmd1.Caption
Case Is = "Reset"
cmd1.Caption = "Start"
cmd1.BackColor = vbGreen
cmd2.Visible = False
StopIt = True
Case Else
Dummy = InputBox("How Many Minutes?", "Countdown timer", "15")
EndTime = Timer + (Val(Dummy) * 60)
cmd1.Caption = "Reset"
cmd1.BackColor = vbRed
cmd2.Visible = True
StopIt = False
Call Timer1
End Select
End Sub
Private Sub Timer1()
'Set up variables
Dim Dummy As String
Dim x As Double, h As Double, m As Integer, s As Integer
Loop1:
'Stop the timer loop if done
If StopIt = True Then
cmd2.BackColor = vbCyan
cmd2.Caption = "Time's Up!"
DoEvents
For x = 1 To 100
Beep
Next x
Exit Sub
End If
'Figure out the time in hours, minutes seconds
x = Int(EndTime - Timer)
h = Int(x / 3600)
x = x - (h * 3600)
m = Int(x / 60)
x = x - (m * 60)
s = x
x = (h * 3600) + (m * 60) + s
'build the display string
Dummy = "Time remaining ... " & vbCr & vbCr
If x >= 3600 Then Dummy = Dummy & Str(h) & ":"
If x >= 60 Then Dummy = Dummy & Right(Str(m + 1000), 2)
Dummy = Dummy & ":" & Right(Str(s + 1000), 2)
'Display it
cmd2.Caption = Dummy
DoEvents
'Status background color and set stop flag when done
If x > 60 Then
cmd2.BackColor = vbGreen
Else
cmd2.BackColor = vbYellow
End If
If x < 10 Then
cmd2.BackColor = vbRed
Beep
End If
If x <= 0 Then
StopIt = True
End If
'Catch the display up
DoEvents
'Wait a second
s = Int(Timer)
Do While s = Int(Timer)
DoEvents
Loop
'Do it again
GoTo Loop1
End Sub
Private Sub cmd3_Click()
Application.Quit
End Sub
==========================
Watch for text wrap from the NG
Maybe this is all too much...
oh well.
B
===============
Please spend a few minutes checking out
www.pptfaq.com This link will
answer most of our questions, before you think to ask them.
Change org to com to defuse anti-spam, ant-virus, anti-nuisance
misdirection.