Countdown macro - display settings

Joined
Oct 24, 2022
Messages
2
Reaction score
0
I've been asked to create a deadline countdown in powerpoint - to show how much time there is left to a given point of time in the future. I use the code below and it works just fine.

My question is - how can it be amended so it shows e.g. 96 hours instead of 4 days? or 345 600 seconds instead of 4 days....


Sub countdown()

Dim time As Date
'change the date and time within the brackets
'currently it is 13 October 2022, 3 AM
time = DateSerial(2022, 12, 7) + TimeSerial(13, 0, 0)

Do Until time < Now()
DoEvents
ActivePresentation.Slides(1).Shapes("hours").TextFrame.TextRange = DateDiff("d", Now(), time) & " Days " & Format((time - Now()), "hh:nn:ss")
Loop

End Sub
 

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