Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    5 Star Lounger
    Join Date
    Aug 2001
    Location
    Surrey, United Kingdom
    Posts
    1,001
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Christmas Countdown (2003 SP3)

    Good evening

    I have been asked to make a slide that shows the days,hours and minutes left until Christmas, no problem with the slide, animations etc. but can Powerpoint do the maths (math across the pond) so that when I F5 the slide that has the current date hidden on it it shows a moving countdown?

    Thanks

    Steve
    Cheers

    Steve

    Asking the questions everbody wants the answers too but feels too stupid to ask themselves :-)

  2. #2
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Christmas Countdown (2003 SP3)

    Hi Steve

    I have put a text box on a slide called Text1 and craeted this

    Private Sub cmdButtonTime_Click()
    Dim dtDateNow As Date
    Dim dtXmas As Date
    Dim dtDay As Date

    dtXmas = DateAdd("d", 0, "25-dec-07")

    dtDateNow = Now

    dtDay = dtXmas - dtDateNow


    Me.TextBox1.Value = Format(dtDay, "##") & " day(s) " & Format(dtDay, "hh") _
    & " hours " & Format(dtDay, "mm") & " minutes " & Format(dtDay, "ss") & _
    " seconds"

    End Sub


    HTH
    Jerry

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Christmas Countdown (2003 SP3)

    For anyone mystified about the basics for doing this, please see these past threads:

    Basic Timer (2003 SP2) by stevehocking
    Re: Timer Countdown to Start of Presentation (Office 2000) by tajsimmons
    Automatic clock timer countdown (2000) (multiple suggestions)

  4. #4
    5 Star Lounger
    Join Date
    Aug 2001
    Location
    Surrey, United Kingdom
    Posts
    1,001
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Christmas Countdown (2003 SP3)

    Thats teasing young master bear knowing how useless I am at this VBA malarky

    OK, on the Slide Master I have placed a text box on the Tools menu I have clicked Macro, Record New Macro, Stop, Alt+F11 unashamedly copied and pasted your code into a text box on a userform and called it timer.

    On slide Master clicked on textbox clicked on Tools, Macro, selected Timer, selected Run and, and, and nothing?

    Whithout being impolite, where do I stick it?

    Thanks

    Steve
    Cheers

    Steve

    Asking the questions everbody wants the answers too but feels too stupid to ask themselves :-)

  5. #5
    5 Star Lounger
    Join Date
    Aug 2001
    Location
    Surrey, United Kingdom
    Posts
    1,001
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Christmas Countdown (2003 SP3)

    Thanks Jefferson

    As you can see from my own post that you cite, I can make some good timers that involve minutes, for instance for my daughter who is a school teacher in primary school I made a time with an animated snail who takes 5 minutes to walk along a straight path but these can take about 15 minutes to do, to make one like that to countdown 35 days (which would mean 3 millon odd 1 second time markers) would leave me a little dizzy <img src=/S/confused.gif border=0 alt=confused width=15 height=20>

    Thanks for reminding me though that I have posted at least one suggestion in goodness knows how many years years <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    Thanks

    Steve
    Cheers

    Steve

    Asking the questions everbody wants the answers too but feels too stupid to ask themselves :-)

  6. #6
    3 Star Lounger
    Join Date
    Feb 2007
    Location
    Durham, Durham, United Kingdom
    Posts
    286
    Thanks
    0
    Thanked 10 Times in 10 Posts

    Re: Christmas Countdown (2003 SP3)

    Steve
    To get the code above to run you need to
    A Insert a textbox from the control toolbox
    B Insert a command button from the same toolbox
    C Right click the button > view code and paste in the code above omitting the private sub and End Sub lines (which will already be there) Paste the code between these existing lines

    Having done all this I'm pretty sure that code will not give you a countdown but the current position which won't change.

    You would need to add at least a Do Until / Loop around the code and a DoEvents within the loop to update the screen I think. This is pretty dodgy programming as the loop will not stop even in edit mode but it should work OK!
    Attached Files Attached Files

  7. #7
    5 Star Lounger
    Join Date
    Aug 2001
    Location
    Surrey, United Kingdom
    Posts
    1,001
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Christmas Countdown (2003 SP3)

    Hi John

    Thanks for that but it does not seem to work, when I open your zipped version nothing happens when I click the button so I made a new PP and followed your notes and used Jezza's code and it did work to a fashion, if I clicked it every now and again the seconds would decrease but never the minutes etc. when I added to the Do event - Loop part it stopped working althogether.

    Thanks for everybodies efforts

    Steve
    Cheers

    Steve

    Asking the questions everbody wants the answers too but feels too stupid to ask themselves :-)

  8. #8
    3 Star Lounger
    Join Date
    Feb 2007
    Location
    Durham, Durham, United Kingdom
    Posts
    286
    Thanks
    0
    Thanked 10 Times in 10 Posts

    Re: Christmas Countdown (2003 SP3)

    Strange it works fine here. Are you sure you haven't got macro security to high (above medium" and you enabled them when asked?
    If you right click the button in edit mode you should see the code

  9. #9
    5 Star Lounger
    Join Date
    Aug 2001
    Location
    Surrey, United Kingdom
    Posts
    1,001
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Christmas Countdown (2003 SP3)

    Thanks John

    Thats one problem solved, I installed 2003 on my home machine at the weekend and installed SP3, it seems to have reset all of my security levels which I have now adjusted.

    The seconds countdown fine but never adjust the minutes, I will have a play to see if I can do anything but don't worry too much, its just that she who must be obeyed wanted something running in reception.

    Cheers

    Steve
    Cheers

    Steve

    Asking the questions everbody wants the answers too but feels too stupid to ask themselves :-)

  10. #10
    5 Star Lounger
    Join Date
    Aug 2001
    Location
    Surrey, United Kingdom
    Posts
    1,001
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Christmas Countdown (2003 SP3)

    I have found a nice add in that puts sime nice time features into Powerpoint

    http://www.tushar-mehta.com/powerpoi...imer/index.htm

    it does not answer my question but I thought it a useful tool to post

    Cheers

    Steve
    Cheers

    Steve

    Asking the questions everbody wants the answers too but feels too stupid to ask themselves :-)

  11. #11
    3 Star Lounger
    Join Date
    Feb 2007
    Location
    Durham, Durham, United Kingdom
    Posts
    286
    Thanks
    0
    Thanked 10 Times in 10 Posts

    Re: Christmas Countdown (2003 SP3)

    Try This
    Attached Files Attached Files

  12. #12
    5 Star Lounger
    Join Date
    Aug 2001
    Location
    Surrey, United Kingdom
    Posts
    1,001
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Christmas Countdown (2003 SP3)

    Fantastic John

    Thanks very much for your efforts

    Steve
    Cheers

    Steve

    Asking the questions everbody wants the answers too but feels too stupid to ask themselves :-)

  13. #13
    New Lounger
    Join Date
    Dec 2008
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='JohnWilson' post='677698' date='20-Nov-2007 19:20']Try This[/quote]

    I've altered John's code to use in a 2003 PowerPoint presentation to count down the days until a specific event to include seconds. (I posted the code below.)

    However, the minutes change when the seconds change to 29. While I basically understand John's code (and thank you John for sharing!) I'm baffled on how to fix this.

    Also, ideally I would like the text box to be on the MasterSlide so the countdown could be started via a command button on Slide 1 and visible and actively counting down through Slide xx, but my attempts to do so have NOT been successful and I'm running outta swear words.

    A most gracious "Thank you VERY MUCH!" to all on this site who help us with these dilemmas.

    Private Sub CommandButton1_Click()

    'http://www.wopr.com/index.php?showto...4&hl=countdown
    'Courtesy of John Wilson

    Dim dtDateNow As Date
    Dim dtXmas As Date
    Dim dtdiff As Double
    Dim Idays As Double
    Dim Ihrs As Double
    Dim Imins As Double
    Dim Isecs As Double
    Dim TestHours As Double

    Dim SecondsDif As Double
    Dim MinutesDif As Double
    Dim HoursDif As Double
    Dim DaysDif As Double

    Dim ModSecondsDif As Double
    Dim ModMinutesDif As Double
    Dim ModHoursDif As Double
    Dim ModDaysDif As Double

    Do Until dtDateNow = "01-mar-10"

    dtdiff = DateDiff("s", Now, #3/1/2010#)

    Idays = dtdiff / 86400

    dtdiff = dtdiff Mod 86400

    Ihrs = dtdiff / 3600

    dtdiff = dtdiff Mod 3600

    Imins = dtdiff / 60

    dtdiff = dtdiff Mod 60

    Isecs = dtdiff

    Me.TextBox1.Value = CInt(Idays) & " Days " & _
    IIf(CInt(Ihrs) < 10, "0" & CInt(Ihrs), CInt(Ihrs)) & ":" & _
    IIf(CInt(Imins) < 10, "0" & CInt(Imins), CInt(Imins)) & ":" & _
    IIf(CInt(Isecs) < 10, "0" & CInt(Isecs), CInt(Isecs)) & " until event!"

    DoEvents

    Loop

    End Sub

  14. #14
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Try replacing the three division operators / with the integer division operator \

    ...
    Idays = dtdiff \ 86400
    dtdiff = dtdiff Mod 86400
    Ihrs = dtdiff \ 3600
    dtdiff = dtdiff Mod 3600
    Imins = dtdiff \ 60
    dtdiff = dtdiff Mod 60
    ...

  15. #15
    New Lounger
    Join Date
    Dec 2008
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you Hans!! That fixed the countdown problem.

    OK - I'm greedy and still looking for answers.

    Is it possible to place the countdown on the slide master to be activated by a command button on Slide 1 - so the countdown is actively running on each slide from beginning to end without having to press another command button?

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •