Header
PowerPoint tips, hints and tutorials that will change your presentations for ever!

INDEX

 

Jigsaws
Sounds
Video
Custom Shows
vba code
NaviSlides
Games for teachers
Bullets
Triggers
Security
Flash Cards
Multiple Instances
PowerPoint 2007
Mail Merge
Random events
Animation
Hyperlinks
Set spellcheck language


Home buttonTutorial buttonContact buttonProducts button


A Timer for a PowerPoint Slide

You may already know how to create a timer, maybe for a break timer that counts up or down.

You can do this by using a large number of duplicate shapes each with different text, aligning them all to overlay each other and then create timed animations to add or remove shapes.

There's an example by Andrew May here. This can look great but it can take an age to create all the shapes and animate them all with delays. If you don't want to use vba in the presentation though it's a good answer.

vba to the rescue then (not included in the final presentation though!)

Simply create ONE shape with text in the style you need (Any text will do), select it and run the macro below.

Alchemy! A two minute counter ready animated.

You can change the code to have any duration and have it count down or up.

The Code

Sub duper()
Dim oshpRng As ShapeRange
Dim osld As Slide
Dim oeff As Effect
Dim i As Integer
Dim Iduration As Integer
Dim Istep As Integer
Dim dText As Date
Dim texttoshow As String
On Error GoTo errhandler
If ActiveWindow.Selection.ShapeRange.Count > 1 Then
MsgBox "Please just select ONE shape!"
Exit Sub
End If
Set osld = ActiveWindow.Selection.SlideRange(1)
ActiveWindow.Selection.ShapeRange(1).Copy

'change to suit
Istep = 5
Iduration = 120 'in seconds

For i = 0 To Iduration Step Istep
Set oshpRng = osld.Shapes.Paste
dText = CDate(i \ 3600 & ":" & ((i Mod 3600) \ 60) & ":" & (i Mod 60))
If Iduration < 3600 Then
texttoshow = Format(dText, "Nn:Ss")
Else
texttoshow = Format(dText, "Hh:Nn:Ss")
End If
oshpRng(1).TextFrame.TextRange = texttoshow
oshpRng(1).ZOrder (msoSendToBack)
Set oeff = osld.TimeLine.MainSequence _
.AddEffect(oshpRng(1), msoAnimEffectAppear, , msoAnimTriggerAfterPrevious)
oeff.Timing.TriggerDelayTime = Istep
oeff.Exit = True
Next i
ActiveWindow.Selection.ShapeRange(1).Delete
Exit Sub
errhandler:
MsgBox "**ERROR** - Maybe nothing is selected?"
End Sub

 

Adapting the Code

As it stands the code produces a 120 second timer in 5 second intervals

To change the duration of the timer simply change the value of Iduration
To change the interval change the value of Istep
NOTE Iduration should be an exact multiple of Istep!
To make the code countdown instead of up reverse the loop and make Istep > -Istep

eg

For i=Iduration to 0 Step -Istep

The code is NOT required to make the timer run. Once you have made the timer the code module can either be deleted or all the shapes copied and pasted to a new presentation

Sample Presentation Made with this macro

How to use vba code in PowerPoint

This is great but it won't work across slides to time the whole presentation. In fact this is difficult to do without vba or Add Ins. One way is to use a video. We have a process which minimises the size by using a special video profile to cteate tiny file sizes.

Download a free sample video timer for PowerPoint

Free Animated gif timers

How to make the video play throughout the PowerPoint show.

If you like this we can create a custom video of any time or design at a very reasonable price. Read more

Email for a quote

 
 

Back to the Index Page

POWERPOINT BLOG

Articles on your favourite sport

Free Microsoft PowerPoint Advice, help and tutorials, Template Links
This website is sponsored by Technology Trish Ltd
© Technology Trish 2007
Registered in England and Wales No.5780175
PowerPoint® is a registered trademark of the Microsoft Corporation