Tl;dr: You have a template or have made a lot of master slides you don’t use. You want to share the file and don’t want all the master slides to be shared. Here is a macro to remove them in seconds
This is a random tip, but something you probably will never know that you can do. I’ve started using it and thought to make a quick blog to teach you.
Ok, so you bought a template and it has 150 master slides. Maybe you have a bunch of proprietary master slides you don’t want to share beyond the ones you are sharing with someone. Maybe you are just anal. Who knows.
You have used 10 master slides and don’t want people to see the 140 you are not using when sharing a PowerPoint file.
Only which ones did you use, and which did you not? You don’t want to accidentally delete ones that you used.
You could do the manual thing and manually check one by one, or you could use magic to do it in seconds.
This is the magic version.
Here is how to do it step by step.
First, make a new VBA macro
To create a macro, do the following (It’s not as scary as you think):
1/ On the View tab, choose Macros.
2/ In the Macro name: dialog box at the very top left, type a name for the macro (Type anything like “asd”, it doesn’t matter!).
3/ In the Macro list on the right-hand side (5 down), click create (see above).
4/ In the Description box, delete the lines of code that come up (the Sub stuff) and then copy paste the macro code in (it’s in the next section).
5/ Code looks like this. Click Play to run the macro.
6/ It runs. Done!
The macro code
You copy and paste the following code into the macro (module):
Sub SlideMasterCleanup() 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 End Sub
Then you press run as above.
Boom. Done. That’s it.
All the master slides you are not using are gone.
Send the file!
If you ever find a macro you like online, do the same process to run it. You now know how to run macros. It’s very similar in Excel too.
Get in the game
Free tools and resources like this shipped to you as they happen.
This is great! Easy to follow your instructions and to do! Is there any easy way to save this to powerpoint so you don’t have to create each time?
Hey Dave – Cheers.
I just save the code to somewhere convenient and then make a macro and run it. I don’t do so many macros all the time to warrant the pain of the alternative.
Gr… um, you can make a custom ribbon for macros which you can then install. If you have say 10 you use a lot it might make sense.
I made one to tick off my nerd list in excel, you can see it here: https://www.alexanderjarvis.com/50folds-excel-productivity-addin-for-modeling/
It is NOT a simple thing to do though. Unless you are a big nerd and enjoy the process of learning, you don’t really want to go there. You might be able to get someone on upwork to do it for you though. I got a Russian to help me with the codes for my macros but the process of making the ribbon I had to figure out. Again… sure you can find someone if you look.
Thank you so much for the magic. 🙂
I tried this but the Slide Master stay and the unused layouts are erased.
Is there a way to spot orphan Slide Masters (who’s all layouts are deleted) and erase?
Tom- If you have a weird structure the code might not work.
I’ve dealt with this stuff for so long to only rely on hacks so much.
I ALWAYS check anyway.
See stuff like this as a hack not an absolute solution, especially if you have clients…
Oh my god, where has this been all my life? Thank you, thank you, thank you.
Thanks for your sharing. I have a large number of powerpoint files (i.e. over a thousand) which have unused master slides to be removed. Are there any ways to remove them without opening powerpoint files and run Macros one by one? Thanks a lot.
Dave- not being patronising, but let me teach you something huge I learned and am still learning.
Anything technical that will take more than 20 minutes to figure out, just hire someone!
I swear to god, just go to upwork, put up a job and there will be a nerd who won’t cost that much that will tell you yes/no, or just do it.
I’ve been cheap for so long, and now I just get other people to solve problems and life is just so much less stress and productive.
I wanted to make this insane free resource and kept putting it off and I hired 3 people and it’s going to just get done for you guys now.