• Christmas Countdown (2003 SP3)

    Author
    Topic
    #446299

    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

    Viewing 2 reply threads
    Author
    Replies
    • #1084548

      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

      • #1084584

        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

    • #1084578

      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)

      • #1084586

        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 confused

        Thanks for reminding me though that I have posted at least one suggestion in goodness knows how many years years smile

        Thanks

        Steve

        • #1084647

          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!

          • #1084726

            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

            • #1084733

              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

            • #1084735

              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

    • #1084865

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

      http://www.tushar-mehta.com/powerpoint/ppt_timer/index.htm%5B/url%5D

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

      Cheers

      Steve

      • #1084871

        Try This

        • #1084989

          Fantastic John

          Thanks very much for your efforts

          Steve

        • #1183279

          Try This

          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?showtopic=677344&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

          • #1183280

            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

          • #1183298

            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?

            • #1183399

              I tried to do that, but couldn’t get text in the master slide to be updated on the fly. But I’m not very good at PowerPoint VBA, hopefully someone else knows whether it’s possible at all and if so, how.

            • #1183438

              I tried to do that, but couldn’t get text in the master slide to be updated on the fly. But I’m not very good at PowerPoint VBA, hopefully someone else knows whether it’s possible at all and if so, how.

              Thanks for trying Hans.

              Some code I tried would not update the Master slide during the slideshow, but when I went back to the normal/edit view of the slides the Master slide countdown clock was active and running and would continue to run until I viewed my code. Very wierd.

              Still looking (as time permits) for a solution.

              TJ

    Viewing 2 reply threads
    Reply To: Christmas Countdown (2003 SP3)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: