Randomizing slides in PowerPoint can be helpful for a number of reasons. This might help call out a specific individual randomly from the audience, help conduct a quiz, or shuffle slides to jump to a random topic. Randomizing onscreen questions can make some PowerPoint templates with quiz layouts more interesting. Unlike sorting slides manually via Slide Sorter view in PowerPoint, you can automatically shuffle random slides in PowerPoint.
How to Shuffle Slides in PowerPoint
Enable the Developer Tab in PowerPoint
To manually shuffle slides in PowerPoint, you can go to View -> Slide Sorter and drag slides to shuffle them. However, to do it manually, you must create a Macro. For this purpose, you will require the Developer tab in PowerPoint to be enabled. In case the tab isn’t visible, right-click anywhere on the Ribbon menu and select Customize the Ribbon.
Enable the Developer tab and click OK. This will show the tab on the Ribbon menu.
Create a Macro
From the Developer tab in PowerPoint, click Macros.
Name the macro with a name and click Create.
Code to Shuffle Slides by Slide Number
Copy the code below and name the slide shuffle order according to need. For example, if you want slides 2-7 to shuffle, add 2 for the First Slide and 7 for the Last Slide in the code.
Sub ShuffleSlides()
FirstSlide = 2
LastSlide = 7
Randomize
For i = FirstSlide To LastSlide
RSN = Int((LastSlide - FirstSlide + 1) * Rnd + FirstSlide)
ActivePresentation.Slides(i).MoveTo (RSN)
Next i
End Sub
Code to Shuffle Slides when the Final Number of Slides is Uncertain
If your slide deck keeps changing and you’re not sure how many slides might be in it when you need to present the slide deck, add ‘ActivePresentation.Slides.Count’ for LastSlide in the code. You can copy the code below for use for the Macro. Select the FirstSlide according to the slide with which you wish to start the shuffle.
Sub ShuffleSlides()
FirstSlide = 2
LastSlide = ActivePresentation.Slides.Count
Randomize
For i = FirstSlide To LastSlide
RSN = Int((LastSlide - FirstSlide + 1) * Rnd + FirstSlide)
ActivePresentation.Slides(i).MoveTo (RSN)
Next i
End Sub
Test the Code in PowerPoint
To test the code, click the Run button to see how your slides will shuffle in PowerPoint using the Macro.
Create a Button to Shuffle Slides
Add a shape to your slide to create a button to automate the shuffling process. You can add any shape via Insert -> Shapes.
You can also label the button with text via Insert -> Text -> Text Box.
Once the button text is added, you can customize the colors and position on the slide according to need.
Select the shape and go to Insert -> Links -> Action.
From the dialog box, go to Run Macro and select the macro you created from the dropdown list. Click OK to close the dialog box and copy the button to any slide you would like to click on to shuffle slides. You can copy the button across all slides or just a single slide, according to need.
Save the file as a macro-enable (PPTM format) via File -> Save As.
The below example shows the shuffle button in SlideShow mode in a macro-enabled PPTM file. To shuffle slides mid-presentation, open your PPTM file to present your slides and click the button to rearrange your defined slides automatically. For example, if you have set the macro to shuffle slides 2-7, clicking the button will randomize the slides from 2-7 by changing the sequence.
Final Words
Now that you know how to randomize slides in PowerPoint, you can try out the slide shuffling method mentioned above to create random sets of quizzes and other audience engagement slide decks. Suppose you are a teacher who needs to randomly call students for an activity or a presenter looking to engage the audience through random questions. In that case, the method mentioned above can be used to shuffle slides in PowerPoint during your presentation session. This method can also have many other uses; however, save your slide deck as a macro-enabled file to ensure your code isn’t erased.