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
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