I import a slide deck of <100 slides weekly for a report. On every single one of these slides is a table that I need to delete. Is there a way to delete them all at the same time?
I import a slide deck of <100 slides weekly for a report. On every single one of these slides is a table that I need to delete. Is there a way to delete them all at the same time?
Put this in a standard module and see
If the table is in a Placeholder, it won't delete it -- just deletes inserted tables
Option Explicit Sub DeleteTables() Dim oPres As Presentation Dim oSlide As Slide Dim oShape As Shape Set oPres = ActivePresentation For Each oSlide In oPres.Slides For Each oShape In oSlide.Shapes If oShape.Type = msoTable Then oShape.Delete End If Next Next End Sub
Last edited by Aussiebear; 04-16-2023 at 11:12 PM. Reason: Adjusted the cod tags
---------------------------------------------------------------------------------------------------------------------
Paul
Remember: Tell us WHAT you want to do, not HOW you think you want to do it
1. Use [CODE] ....[/CODE ] Tags for readability
[CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
2. Upload an example
Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
3. Mark the thread as [Solved] when you have an answer
Thread Tools (on the top right corner, above the first message)
4. Read the Forum FAQ, especially the part about cross-posting in other forums
http://www.vbaexpress.com/forum/faq...._new_faq_item3
As Paul said as written tables in placeholders will not be deleted. You can force this by replacing
If oShape.Type=msoTable Then WITH if oShape.HasTable Then
Last edited by Aussiebear; 04-16-2023 at 11:13 PM. Reason: Adjusted the code tags
John Wilson
Microsoft PowerPoint MVP
Amazing Free PowerPoint Tutorials
http://www.pptalchemy.co.uk/powerpoi...tutorials.html