PDA

View Full Version : [SOLVED:] Macro to advance to next slide; on next use, advance to "next slide + 1"



Thaxor
12-16-2013, 07:11 AM
Hello there

I'm making a PowerPoint (2010) based "board game" (Mario Kart to be precise :D) 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 :D

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!

John Wilson
12-16-2013, 12:51 PM
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.

Thaxor
12-16-2013, 03:48 PM
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.

John Wilson
12-17-2013, 01:54 AM
PowerPoint Alchemy is my company and yes I mostly write the content.