Formatting Issues

How to Exclude Hidden Slides From PowerPoint Slide Numbers

Muhammad TalhaMuhammad Talha Oct 21, 2026 869 views

Question details

The user wants to prevent hidden slides from being counted in the overall slide numbering so that visible slides display consecutive numbers.

How to Exclude Hidden Slides From PowerPoint Slide Numbers
Product
PowerPoint
Device & OS
not provided
Scenario
Formatting a presentation where certain slides are hidden for specific audiences, but the visible slide numbers must remain sequential without gaps.
Observed behavior
Built-in slide numbering includes hidden slides, causing the numbering on visible slides to skip values.
Before you start

Before applying a macro, ensure you have saved a backup copy of your presentation. If you plan to use VBA, you will need to save your file in a macro-enabled format.

Solution 1Recommended

Use a VBA Macro to Renumber Visible Slides

Applying a custom VBA macro is the most efficient way to assign consecutive numbers only to visible slides.

PowerPoint does not have a native toggle to exclude hidden slides from numbering. A VBA script can loop through your presentation, skip the hidden slides, and add sequential text boxes acting as slide numbers to the visible ones.

1
Open the VBA Editor

Press Alt + F11 on your keyboard to open the Microsoft Visual Basic for Applications window.

2
Insert a new module

Click on 'Insert' in the top menu and select 'Module' to create a blank workspace for your code.

3
Paste the numbering code

Paste a VBA script designed to skip hidden slides. Standard scripts for this can be found in developer forums. The script will generate custom text boxes with sequential numbers.

4
Run the macro

Press F5 or click 'Run' to execute the script. The custom numbers will appear on your visible slides.

Use a VBA Macro to Renumber Visible Slides
Macro Re-execution: Whenever you add, delete, or rearrange slides in your presentation, you must run the macro again to update the slide numbers accurately.
Free Microsoft Office alternative

Create and Format Presentations Seamlessly with WPS Office

While presentation software sometimes requires complex VBA workarounds for specific formatting limits, WPS Office offers a free, lightweight, and highly compatible alternative for all your presentation needs. It fully supports Microsoft PowerPoint formats and provides an intuitive interface for seamless creation.

  1. 1. Download and Install WPS Office: Visit the official WPS Office website to download the free suite and install it on your computer.
  2. 2. Open your Presentation: Launch WPS Presentation and open your existing .pptx files to continue editing instantly.
  3. 3. Edit and Save: Make your formatting adjustments and save the file seamlessly in PowerPoint compatible formats.
Highly compatible with Microsoft PowerPoint (.pptx) formatsSupports advanced presentation formatting and multimediaFree and lightweight alternative to Microsoft OfficeFamiliar user interface for easy transition
microsoft office alternative - wps office

Frequently Asked Questions

Why do my slide numbers skip when I hide a slide?

By default, presentation software counts every slide in the file, whether it is hidden or visible. This causes the visible numbering to skip a digit when a slide is hidden from the main presentation flow.

Do I need to save my file differently if I use a macro?

Yes. If you use a VBA macro to fix slide numbering, you must save your presentation as a Macro-Enabled Presentation (such as .pptm) to retain the code for future edits.

Will the slide numbers update automatically if I add new slides?

If you used the VBA macro method or manual text boxes to skip hidden slides, the numbers will not update automatically. You must run the macro again or manually adjust the text boxes after adding, deleting, or reordering slides.