Skip to content

Instantly share code, notes, and snippets.

@seanorama
Last active April 7, 2017 08:58
Show Gist options
  • Save seanorama/17c02d68c5c9828e62565219aebaa1c4 to your computer and use it in GitHub Desktop.
Save seanorama/17c02d68c5c9828e62565219aebaa1c4 to your computer and use it in GitHub Desktop.
powerpoint macros
' Purpose: Removed unused master slides
' Author: Sean Roberts <[email protected]>
' Instructions: Add Macro and Run.
' + I like to keep a blank presentation named "powerpoint-macros" to keep all macros attached to.
' + You can then open it and execute from the presentation you are editing, without adding the macro to your presenation.
Sub Delete_unused_master_slides()
Dim I As Integer
Dim J As Integer
Dim oPres As Presentation
Set oPres = ActivePresentation
On Error Resume Next
With oPres
For I = 1 To .Designs.Count
For J = .Designs(I).SlideMaster.CustomLayouts.Count To 1 Step -1
.Designs(I).SlideMaster.CustomLayouts(J).Delete
Next
Next I
End With
MsgBox ("Unused Master slides removed")
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment