Search code examples
vbapowerpoint

How to show time in seconds greater than 60 in Format("ss")


When time- Now() is less than 60 then Shapes("countdown").TextFrame.TextRange = Format((time - Now()), "ss") gives me the output perfectly.

However, when it is greater than 60, say 111, then the output starts with 51 surprisingly. I tried changing the format to sss but that definitely didn't work.

I would love your take and suggestions for this. My objective is to have a countdown timer from 111,110,109,...0.


Solution

  • Just for the sake of the next person that find this question, the format can use normal brackets [ ] to show hours, minutes or seconds, over 60 seconds or minutes or 24 hours respectively.

    Format((time - Now()), "[ss]")
    

    Reference:

    https://www.ablebits.com/office-addins-blog/show-time-over-24-hours-excel/ https://excelchamps.com/formulas/minutes-into-hours/