Use a PowerPoint Macro to Jump to a Slide by Page Number

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

 

Enable the Developer Tab

  1. Go to FileOptions
  2. Select Customize Ribbon
  3. On the right, check the box for Developer
  4. Click OK to enable the tab

Step 2: Create a New Macro

Create a New Macro

  1. Click on the Developer tab
  2. Click Macros
  3. Enter a macro name like GoToSlide
  4. 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.

  1. Click FileSave As
  2. Select PowerPoint Macro-Enabled Presentation (*.pptm)
  3. Click Save

Step 5: Run the Macro

  1. Go to the Developer tab
  2. Click Macros
  3. Select GoToSlide from the list
  4. Click Run
  5. Enter a slide number in the input box

How the Macro Works

  1. InputBox asks for a slide number
  2. IsNumeric() checks for numeric input
  3. If valid, Slides(n).Select jumps to the slide
  4. 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!

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다