If you’re working with a large PowerPoint presentation, scrolling to a specific slide can be time-consuming. Just like in Excel, you can automate repetitive tasks in PowerPoint using macros. In this tutorial, you’ll learn how to create a macro that lets you jump to any slide simply by entering its page number.
Why Use a Slide Jump Macro in PowerPoint?
- Quickly navigate large presentations
- Save time during editing or live presentations
- Reduce mouse clicks and manual scrolling
Step 1: Enable the Developer Tab
- Go to File → Options
- Select Customize Ribbon
- On the right, check the box for Developer
- Click OK to enable the tab
Step 2: Create a New Macro
- Click on the Developer tab
- Click Macros
- Enter a macro name like
GoToSlide
- Click Create to open the VBA editor
Step 3: Insert the VBA Code
Sub GoToSlide()
Dim sPageNo As String
Dim nPageNo As Integer
sPageNo = InputBox(\"Which slide number would you like to go to?\")
If IsNumeric(sPageNo) Then
nPageNo = Val(sPageNo)
If nPageNo < 1 Or nPageNo > ActivePresentation.Slides.Count Then
MsgBox \"The slide number is out of range.\"
Exit Sub
End If
ActivePresentation.Slides(nPageNo).Select
Else
MsgBox \"Please enter a valid number.\"
End If
End Sub
Step 4: Save the File as .pptm
Macros require a special file format. You must save your presentation as a PowerPoint Macro-Enabled Presentation (*.pptm). If you save it as .pptx, the macro will be lost.
- Click File → Save As
- Select PowerPoint Macro-Enabled Presentation (*.pptm)
- Click Save
Step 5: Run the Macro
- Go to the Developer tab
- Click Macros
- Select
GoToSlide
from the list - Click Run
- Enter a slide number in the input box
How the Macro Works
- InputBox asks for a slide number
IsNumeric()
checks for numeric input- If valid,
Slides(n).Select
jumps to the slide - Out-of-range or non-numeric input triggers a message box
FAQs
1. Which PowerPoint versions support this macro?
All versions from PowerPoint 2010 to Microsoft 365 Desktop support VBA macros.
2. Can I assign this macro to a shape or button?
Yes! Right-click a shape → Assign Macro → choose GoToSlide
.
3. What if I enter text instead of a number?
The macro will show an error and stop execution.
4. Can I use this during a live presentation?
Yes, but macros are not supported in presentation mode. You must use it during editing.
5. Is there a way to undo the slide jump?
Not directly. You’ll need to manually go back or note the previous slide number.
Final Thoughts
This simple macro can save you time and effort while working in PowerPoint. Whether you’re building or reviewing a long presentation, jumping to a specific slide by page number can be a game-changer. Try it out and make your workflow faster and smarter!