So I have a Slide on PowerPoint where I have a Macro that should delete all shapes with the name that starts with "element". It does delete the shapes that I want, but not all. I have to run the macro again and then it deletes another bunch of them. So it seems not to be deleting all at once.
Can someone help me? Here's the Macro:
Sub course_reset()
Dim shp As Shape
For Each shp In Slide36.Shapes
If Left(shp.Name, 7) = "element" Then shp.Delete
Next
End Sub
ShapeRange
, set it toSlide36.Slides.Range
and then do thefor each
for theShapeRange
, it works! Thank you anyways for the quick reply. - Daniel Clímaco