Office Settings & Configuration

Count Slide Masters and Layouts in PowerPoint

Huma Ashraf ChHuma Ashraf Ch Nov 18, 2026 869 views

Question details

Count the slide masters and the total layouts associated with them in a PowerPoint presentation.

How to Count Slide Masters and Layouts in PowerPoint
Product
Microsoft PowerPoint
Device & OS
not provided
Scenario
A presentation contains multiple slide masters and many layouts, and the user wants a quick count.
Observed behavior
The desired result is a count of slide masters and a combined count of their layouts.
Before you start

Open the presentation you want to count in desktop PowerPoint. Make sure the Visual Basic editor is available and that your organization's macro security settings permit you to run the macro.

Solution 1Recommended

Run a VBA Macro to Count Masters and Layouts

Use this macro to display the number of designs and the total layouts across their slide masters.

The macro counts PowerPoint designs as slide masters and adds up the CustomLayouts collection for each master. The layout total includes all layouts in those collections, not just layouts manually created by a user.

1
Open the Visual Basic editor

With the target presentation active in desktop PowerPoint, select Developer > Visual Basic. If the Developer tab is hidden, enable it in PowerPoint's ribbon settings.

2
Add a module

In the Visual Basic editor, select Insert > Module and paste this code: Sub CountMastersAndLayouts() Dim x As Long Dim lLayouts As Long With ActivePresentation MsgBox .Designs.Count & " slide masters" For x = 1 To .Designs.Count lLayouts = lLayouts + .Designs(x).SlideMaster.CustomLayouts.Count Next x MsgBox lLayouts & " layouts" End With End Sub

3
Run the macro

Return to the target presentation, select Developer > Macros, choose CountMastersAndLayouts, and select Run. Dismiss the first message to see the layout total.

Run a VBA Macro to Count Masters and Layouts
Keep the macro if needed: If you want to retain the macro in the presentation, use File > Save As and choose a macro-enabled PowerPoint presentation format (.pptm).
Free Microsoft Office alternative

Work With PowerPoint Presentations in WPS Office

WPS Office is a free, lightweight alternative for working with presentations in a familiar interface. Open compatible PowerPoint files to make the move between applications easier; the PowerPoint VBA macro above is not a WPS fix.

Open and edit compatible PowerPoint PPT and PPTX filesWork with slide masters and layouts in presentationsUse a familiar interface for everyday presentation editingMove existing Office files into a lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Does the macro count only layouts I created myself?

No. It counts every layout in each slide master's CustomLayouts collection, including layouts that came with the presentation or theme.

How can I see the slide masters and layouts without running a macro?

Select View > Slide Master in PowerPoint. The pane shows slide masters and their associated layouts, which you can inspect or count manually.

Why can't I see the Developer tab?

The Developer tab may be hidden. Enable it in PowerPoint's ribbon settings, then select Developer > Visual Basic or Developer > Macros.

Do I need to save the presentation as a PPTM file?

Use File > Save As and choose PowerPoint Macro-Enabled Presentation (.pptm) if you want to keep the VBA code in the presentation. A standard PPTX file cannot retain VBA macros.