Did you know it’s possible to create your own quiz slides in Microsoft PowerPoint using its macro functions and doing a little programming in Visual Basic for Applications (VBA)?
You can use quiz slides to make presentations more engaging and fun. They work something like this: Each slide asks a question and displays answer choices. Quiz-takers then click on the answer they think is correct. If they answer correctly, a Congratulations message appears and they automatically move on to the next slide. If they choose a wrong answer, they receive a “try again” message. The slideshow will not advance until they select the correct answer.
You may think that working with VBA is too complicated, but it’s easier than you might think. This VBA code is easy to understand and, for this tip I was able to use Visual Basic to create a 10-slide quiz in less than an hour.
Step 1: Create multiple-choice slides
The first step is to create the question slides. In PowerPoint, start a new slide using the Title Only slide layout. Type the first question in the title placeholder.
To add the multiple-choice answers, go to the Draw toolbar and choose AutoShapes> Action Buttons. (2007: Home tab> Drawing group> Shapes> Action Buttons section) Then choose the blank action button. Now click on the slide and the new button will appear. When the Action Settings dialog box appears, choose Cancel. You’ll return to this box later in the tutorial.
Resize and position the button on the slide. For consistency, size the button to allow for the longest text answer. Format the button as desired.
Right-click on the button, choose Add Text from the shortcut menu, and type the first answer. Now select the button, copy it to the Clipboard, and paste additional copies of the button graphic for the remaining answers you’ll need on the slide.
When all the buttons are in place, select each individually and edit its text. You can also align and distribute the answer buttons on the slide. Select them all. Choose Draw toolbar> Align or Distribute, Align Left, then Draw toolbar> Align or Distribute> Distribute Vertically. (In PowerPoint 2007: Drawing Tools Format tab> Arrange group> Align button> Align Left, then Align button>Distrubte Vertically)
Repeat this process to create each additional question slide.
Tip: Within the Slide Sorter view, you can COPY (CTRL+C) the first question slide and PASTE it as many times as needed to quickly create the remaining question slides. Then return to Normal view to edit each slide’s text.
On your final quiz slide, create an action button with the word End, and place it on the slide.
Step 2: Create macros
When the Q & A slides are done, you’re ready to create the macros using PowerPoint’s Visual Basic Editor. Before you begin, make sure that only the presentation you are currently working on is open.
To open the Visual Basic Editor, choose Tools> Macro> Visual Basic Editor.
In 2007 and later, you first need to display the Developer tab if it isn’t already displayed. (By default, it is not displayed.)Choose Office button> PowerPoint Options. In PowerPoint 2007, in the Popular category, check the Show Developer Tab in the Ribbon check box. In PowerPoint 2010 and 2013, go instead to the Customize Ribbon category. On the right side of the dialog box, check the Developer check box.
Then, to open the Visual Basic Editor, choose Developer tab> Code group> Visual Basic.
The editor opens in a new window. The right side of the window will be gray. From the insert menu choose module and you’ll see a blank white area where you can type a macro. We’ll create three macros.
We’ll start with the code for the wrong answer. In the big blank space on the right, type the following on three lines:
Sub Wrong()
MsgBox (“Sorry, that’s not right. Please try again.”)
End Sub
In certain situations, if you make a mistake, the editor will warn you, but the message may not be clear to you. Most often the mistake is a result of mistyping the code. You may have left out one of the quotation marks or the closing parenthesis at the end of a line. Double-check your typing and make adjustments until the Editor shows no warnings.
Next is the code for the right answer. At the end of the line reading “End Sub,” press Enter. This begins a new code group. Then type the following four lines:
Sub Right()
MsgBox (“That’s right!”)
SlideShowWindows(1).View.Next
End Sub
This code is similar to the previous macro, except for the third line, which advances the quiz-taker to the next slide.
On the final slide, you don’t want the slideshow to advance to the next slide because that starts the presentation all over again. Instead, you want viewers to use a button that exits the slideshow. So after the previous “End Sub,” press Enter again and type your final piece of code:
Sub RightLast()
MsgBox (“Congratulations!”)
End Sub
Step 3: Attach macros to buttons
To return to PowerPoint from the Visual Basic Editor, click the View Microsoft PowerPoint icon (upper left-hand corner, under the File menu link). Leave the Visual Basic Editor open in the background. In PowerPoint, save the presentation, as this saves the new macros as well.
Go to your first question slide and select the button with the correct answer. Note: Select the entire button, not just the text on the button. You do this by clicking on the border around the edge of the button.
Right-click the button and choose Action Settings from the shortcut menu. The Action Settings dialog box appears. Choose the Mouse Click tab, and in the Action on Click section, check the Run Macro option and select your new Right macro from the drop-down list. (Notice that all the macros on this list are named for the three pieces of code you created in the Visual Basic Editor.) Click OK. (Note: Thanks for one of the commenters below for pointing out that you may have to choose Hyperlink instead of Action Settings.)
Now select each of the wrong answers and follow the same procedure, except select the Wrong macro from the drop-down list.
Before going on to the other slides to assign the proper macros, try out the buttons on the first slide. Go into Slide Show view. Click on a wrong answer. A text-message box should pop up indicating you have chosen the wrong answer. Click OK to close the box. Check the other wrong answers on the slide to make sure they also work. Finally, select the correct answer. This time, the text-message box should indicate you have chosen the right answer. Click OK and the slideshow will automatically advance to the next slide.
With the first slide working properly, edit the rest of the presentation, attaching the appropriate macros to the buttons. On the last slide, assign the RightLast macro to the correct answer so that quiz-takers stay on the last slide.
Remember the End button you created on this final slide? Right-click on that button and choose Action Settings. In the Action Settings dialog box, choose the Hyperlink To option and choose End Show from the drop-down list. Click OK. Quiz-takers can use this button when they’re finished answering all the questions.
Be sure to save the PowerPoint file.
Step 4: The final setup
To prevent the quiz-takers from clicking through without answering all the questions, choose Slide Show> Set Up Show. In the Set Up Show dialog box choose the Browsed at a Kiosk (Full Screen)” option under the Show Type area. Click OK. With this setting, the only way someone can get out of the presentation is to use the ESC key.

final setup
Now, go into Slide Show mode and try your quiz, making sure all wrong answers and right answers use the proper macro. If you get a message about macros, you’ll need to tell PowerPoint that you want to run the macros. This is due to PowerPoint’s security settings.
That wasn’t so difficult, was it?
The concept here is from David M. Marcovitz’s book, Powerful PowerPoint for Educators.
thanks for the codes !! :))
Hello there,
When I run my presentation, I can not seem to get this to work. I click on the options and the do not run to the next slide or come up wrong. It stays on the same slide and when I click on a box a dotted line appears around it!
any help?
Ta
Daniel
That is usually because of PowerPoint’s security settings. I’d need to know which version of PowerPoint you have to show you how to change them. But start with Tools>Options or File/Application Button>Options.
I have created a quiz integer add and subtract macros button….that was eay. But when I use my required action button to run my Macros, such as a progressive score button, the Macros window “pops-up” within that slide and is much smaller than the slide itself. It works just fine but is there a way to for the button to make this score open in it’s own slide to keep score? In other words, can I make that pop-up window an actual slide? Thanks for your input please.
R. Owens
I’m not sure I understand and I’m not a programmer, but you can programmatically create a new slide and display the results of calculations there. In my book PowerPoint for Teachers I have a chapter on creating a quiz with VBA using code from David Marcovitz. It displays the score on a list slide that the code creates on the fly. At http://www.loyola.edu/edudept/powerfulpowerpoint/, you can look at some of his code. He lists it by chapter and I don’t know which chapter would have the code you need. If you’re creating more complex quizzes, I recommend that you buy his… Read more »
Hi isnt
SlideShowWindows(1).View.Next supposed to be SlideShowWindow(1).View.Next no s after window???
either way I get syntax error but this almost works
ActivePresentation.SlideShowWindow(1).View.Next
2003 PPT
actually all I want is a text box to hold a value (a score) and have a button add 1 to the value in the text box…
can you assist – you can answer at my email – and if it works feel free to add to this post
Try it like this: ActivePresntation.SlideShowWindow.View.Next
For more information than that, you’d need to ask a programmer, which I am not. Go to the PowerPoint Discussion Group at http://answers.microsoft.com/en-us/office/forum/powerpoint?tab=all and ask the question there. A few programmers frequent the forum.
Great work. The problem I have is when people take the test and they know programming they can right click on the buttons and look at the hyperlink to discover the correct answer. How do I fix that?
Hello, thank you for the info- I have set up several quizzes with your instructions. I know I can easily assign a sound to an action box. How do I asign a sound to the VBS message box? Right now, every time the message boxes appear, the “error” sound is there. I would like to keep it for the wrong answers, but have an “applause” sound for the right answers. Thanks!
Rose,
My VBA skills are pretty limited, so I don’t know how to add a sound in VBA. The error sound might be, well, an error in the code. You might try a non-VBA technique for creating the quiz, but I only have that written out in my ebook, 101 Advanced Techniques Every PowerPoint User Should Know.. You can see a demo at http://www.ellenfinkelstein.com/pptblog/create-a-quiz-in-powerpointdemo-of-technique-7-from-my-e-book/.
Ellen
Hi there,
for some reason when i right click my action button, i dont get the action settings, how do i get the action settings?
Thanks
Hello Ellen,
How can I get my Powerpoint quiz to self grade? I would like for my students to print and send me their results.
Thanks.
Clint,
I have instructions in my book, PowerPoint for Teachers. You can find it on Amazon. It’s too much to put in a blog post–the instructions take up a whole chapter of the book!
I want to Visul Basis coding any quiz contest.
In addition to the code on this page, I have a whole chapter in my book, PowerPoint for Teachers. You can buy it from Amazon.com at this link: http://www.amazon.com/gp/product/078799717X?ie=UTF8&tag=ellenfinkelstein&linkCode=as2&camp=1789&creative=9325&creativeASIN=078799717X
Hello Ellen
Thank you for I see as great work which will be my first step in the world of VBA. I’ll always remember this tutorial.
For some reason the (right) does not make the slides advance, it shows the message and remains at the same slide
It could take quite a while to troubleshoot and I’m not a serious VBA programmer. I suggest that you go to Microsoft’s discussion group and there are VBA programmers there who will help you.
http://answers.microsoft.com/en-us/office/forum/powerpoint?tab=all
Good luck!
Sammer wrote “for some reason when i right click my action button, i dont get the action settings, how do i get the action settings?”
That’s becuase Ellen got it WRONG !!! In PowerPoint 2007 you don’t get “Action Settings” on right-click, you get “Hyperlink”, and from there you can progress.
Hi Ellen i want a visual basic codes for making quiz.Its very important for me so please i am requesting u to give me a visual basic codes for making quiz
Ashu, My book, PowerPoint for Teachers, has a entire chapter on this topic.
Check it out at http://www.amazon.com/gp/product/078799717X?ie=UTF8&tag=ellenfinkelstein&linkCode=as2&camp=1789&creative=9325&creativeASIN=078799717X
I am trying to make a powerpoint presentation were the users will need to enter an answer in the text box but make it so it will only allow to the next screen when the correct text has been entered and or flash up if incorrect, i dont know if this is possible as i am quite new to making presentations. Any ideas would be a great help.
Thanks
That’s how the quiz in this tip works. You can do it without VBA coding as well. It’s one of the techniques in my ebook, 101 Advanced Techniques Every PowerPoint User Should Know (http://www.ellenfinkelstein.com/estore/101advancedtechniques.html) and also in PowerPoint for Teachers (http://www.amazon.com/gp/product/078799717X?ie=UTF8&tag=ellenfinkelstein&linkCode=as2&camp=1789&creative=9325&creativeASIN=078799717X)
Hi Ellen, you might like to know that you can now create an online multiple-choice “answer until correct” quiz, or alternatively a timed exam, simply by uploading a PowerPoint document with one question per slide to QuizSlides.com. (Disclosure: I’m the founder!)
hi ma’m thanks for the guidance..really appreciate clarity of explaining about ppt quiz. really awesome
im doing a quiz program using vba.. and i find it so hard .. tnx for the tips anyway :)) Godbless
i was not getting actually the result, when i was clicked it just blink & no popup had displayed 🙁 please rply me @ my mail or here .. i m in needy position yar..
Thanks, Just a reminder for the new user, please make sure that you save the file as the pptm(it means enable macro)
I have PPT 2008 which apparently does not accept macros. Is there a workdaround?
PowerPoint 2011 brought back support for macros, so I would upgrade.
Good afternoon,
Thanks very much, Ellen, for all these topics.I have learned a lot with your interesting blog.Can i ask you for tutorials about drawing technique’s with powerpoint 2007.
Abder
Hello, if in a quiz, I wanted to keep track of the correct answers as I do?
To create a quiz that keeps track of correct answers, you need some more VBA. I have a chapter in my book PowerPoint for Teachers that covers this topic. (You can buy it on Amazon.com here.) For more information, I recommend David Marcovitz’ book, Powerful PowerPoint for Educators, which is all about using VBA to create quizzes. You can buy that here. It’s an expensive book because it’s considered a textbook.
Is it possible rather than having just the “Incorrect answer” response but a Incorrect with an explanation for why it is wrong? So you would need individual wrong pop ups?
Thank you and can you please help me to add time to a form in the Visual Basic integration with powerpoint?
i want to create quiz game in vb6 with database connectivity how???
I have greated a quiz and its works well, however i would like to use a vba code to work out how long the quiz takes and then convert this is questions right per hour
How can you prevent the file not to be open within powerpoint. Because, if you open the file within the application they would see all slides.
Please email me step by step instruction on how to do a powerpoint quiz .what about doing a power point games
I did a search in my blog on “games” and came up with these:
http://www.ellenfinkelstein.com/pptblog/create-a-quiz-in-powerpointdemo-of-technique-7-from-my-e-book/
http://www.ellenfinkelstein.com/pptblog/create-a-quiz-game/
Have fun!
as a beginner this article say quite understand and very useful for me. thank you
Hi Ellen
thanks a lot I found it too useful and I knew actual use of macro in ppt.
I am making a game with PowerPoint and I really need this and it is very helpful.
If you know then please tell me for control action button with key board like if I want to move the object or fire by object then how to assign a specific button for it from keyboard in PowerPoint 2010.
Thank you again.
Good post, I made a tutorial on my blog with feature of PowerPoint VBA for Great quiz. You can find my blog Here
Thanks for the tips… Works perfect!
Thanks for the code.
I also wish to know how one can code macros so that the dialog box will serve as an avenue for password. So that a user needs to put in the required password before the slide moves to the next.
I can find a way out.
I don’t want my kids going through my set questions.
Thanks.
Thanks a lot! It really works perfectly. Now I can make my quizzes more exciting for my students.
thanks a lot ! it works . but i have a problem i put sound in the macro and gave him the path of sound when i put the power-point file in anther PC it does’t work . how can solve this problem plz ?
Nice text, thanks!
Hi Ellen
Clear instructions (thanks), but none of my buttons work (no messages).
I’m using PP 2016 running in Windows 10 which I suspect is the problem/difference.
This is the closest I’ve come to being able to put live quizzes into my presentations. Frustrating, but hoping you or someone out there can help put the final brick in place (probably something ludicrously simple!).
Keep up the good work, and thanks for your unconditional approach to sharing your skills.
Much appreciated,
Stephen
Very useful information. I have a question, When i use the Right macro for right answer, it pop-up’s saying click ok, which i click it redirects to next slide. But, I need to put answer source as a button beside OK button when it says correct answer.
If i use MsgBox again, it is feasible to do. But i want this way, Is it Possible ??
Please Suggest me what is the best way to get my output !
how can i build a project using ms office applications that can generate various quizzes automatically?