Consulting

Results 1 to 4 of 4

Thread: Macro to advance to next slide; on next use, advance to "next slide + 1"

  1. #1
    VBAX Newbie
    Joined
    Dec 2013
    Posts
    2
    Location

    Macro to advance to next slide; on next use, advance to "next slide + 1"

    Hello there

    I'm making a PowerPoint (2010) based "board game" (Mario Kart to be precise ) as a review game for my students. I have the "board" as a slide and then a series of questions (10 currently) as individual slides.

    Ideally, I want an action button on the "board" that will take me to the first question (next slide). Then, when I return to the "board" and click the button again, it will take me to "next slide +1" (question 2). Repeat as needed, each time advancing to the next question in the series.

    I currently have a work-around non VBA method (a questions page with hyperlinks to the individual question slides), that while functional, is lacking the polish and pizazz I'm hoping to achieve.

    I am, unfortunately, completely green when it comes to VBA. I've done a little coding for modding but nothing serious. Mostly I am completely illiterate to the VBA syntax and I plan on using this in class this week, so I'm appealing to the experts

    My basic idea is something like:

    Goto Next Slide + Increment
    Set Increment = +1
    Repeat
    As noted above, I have no idea what the applicable syntaxes for VBA are, and to boot, I've never been good at recursive code

    If anyone is able to assist (or point me in the right direction), my students, co-workers, and I would be very greatful!

    Thank you!

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    Sub onwards()
    Static lngNum As Long
    lngNum = lngNum + 1
    With SlideShowWindows(1).View
    .GotoSlide (.CurrentShowPosition + lngNum)
    End With
    End Sub
    Maybe

    It can be done without code by having a "stack" of action buttons. The top one has a next slide action AND a disappear when clicked (trigger). The next would have goto next+1 and disappear etc.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    VBAX Newbie
    Joined
    Dec 2013
    Posts
    2
    Location
    John! That works!!! Thank you so much!

    Also, I never would have thought to do the "stack" of action buttons, good trick to have in my pocket.

    Again, thanks so much! The race goes on!

    Edit: I also just noticed you have a link to PPT Alchemy in your sig. If you are responsible for any of that site, double thank you! I found a "choose random slide" macro there that I am using as well.

  4. #4
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    PowerPoint Alchemy is my company and yes I mostly write the content.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

Tags for this Thread

Posting Permissions

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