How to Exclude Hidden Slides From PowerPoint Slide Numbers
Question details
The user wants to prevent hidden slides from being counted in the overall slide numbering so that visible slides display consecutive 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 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.
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.
Press Alt + F11 on your keyboard to open the Microsoft Visual Basic for Applications window.
Click on 'Insert' in the top menu and select 'Module' to create a blank workspace for your 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.
Press F5 or click 'Run' to execute the script. The custom numbers will appear on your visible slides.

Add Slide Numbers Manually
For very short presentations, you can manually insert text boxes with numbers on each visible slide.
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. Download and Install WPS Office: Visit the official WPS Office website to download the free suite and install it on your computer.
- 2. Open your Presentation: Launch WPS Presentation and open your existing .pptx files to continue editing instantly.
- 3. Edit and Save: Make your formatting adjustments and save the file seamlessly in PowerPoint compatible formats.

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.




