Is there a way to delete the text within multiple PowerPoint shapes?

5,740

Using VBA

'All shapes in active slide
Sub DeleteShapeText1()
Dim sh As Shape

   For Each sh In ActiveWindow.View.Slide
      If sh.HasTextFrame Then
         sh.TextFrame.DeleteText
      End If
   Next
End Sub

'Only selected shapes
Sub DeleteShapeText2()
Dim sh As Shape

   For Each sh In ActiveWindow.Selection.ShapeRange
      If sh.HasTextFrame Then
         sh.TextFrame.DeleteText
      End If
   Next
End Sub
Share:
5,740

Related videos on Youtube

Dec
Author by

Dec

Updated on September 18, 2022

Comments

  • Dec
    Dec over 1 year

    I use PowerPoint almost daily as part of my job for reporting. Instead of using text boxes, we like to use Shapes with text inside it to put across ideas e.g. text statements or percentage figures. This is standard practice.

    Sometimes we might have to duplicate the presentation but replace the text and numbers however keeping the Shapes and position exactly the same. Is there a way to delete the text from multiple shapes on a slide at once thus saving me a lot of time?

    Currently, I double-click within each Shape one at a time and then press Delete.

    • Steve Rindsberg
      Steve Rindsberg over 4 years
      Do you need to delete the text from ALL of the shapes on a slide or just some of them, and if the latter, how would you determine which shapes to delete text from and which not? It might be possible to do this with a bit of VBA. Alternatively, there are commercial add-ins that can import the text into a kind of template presentation from an Excel file. A bit of googling will turn up a few. Disclaimer: I wrote and sell one of these (PPTools Merge).
    • Dec
      Dec over 4 years
      It is the latter. Deleting from some of them. Regarding determining which shapes, currently, it is by eye. As an example, it may be that a report has to be produced for multiple countries. For Ireland, the first slide has 7 shapes - 1 shape with introduction text tothe presentation, and 6 shapes of data. We now have to replicate the slide for Scotland - the shape with text can stay the same, but the other 6 shapes with data need updating. Hope that helps?
    • Herb Gu _ MSFT
      Herb Gu _ MSFT over 4 years
      Based on my research, there is no build-in feature to do this. You may follow Steve's suggestion and seek for method of VBA.
    • Steve Rindsberg
      Steve Rindsberg over 4 years
      @Cedric In order to automate this, VBA (or any other language) would need a way to determine which shapes need text deleted and which to leave alone. You could use fill or outline color to distinguish them, or tags to identify them. The add-in I mentioned could create all of the presentations in one go from data in an Excel sheet. You might want to try the fully functional demo.
    • Dec
      Dec over 4 years
      Thanks Steve. How about if it was all shapes on the active slide? Or alternatively, it if it was a mouse drag to select them?