Untitled

Anonymous
Plain Text
09/04/2025 8:29 AM
390 B
15
Indexable
Never
Sub DeleteAllShapesSafe()
    Dim ws As Worksheet
    Dim shp As Shape
    For Each ws In ActiveWorkbook.Worksheets
        For Each shp In ws.Shapes
            On Error Resume Next   ' skip shapes that can't be deleted
            shp.Delete
            On Error GoTo 0
        Next shp
    Next ws
    MsgBox "All possible shapes deleted (some may have been skipped)."
End Sub
Editor is loading...
Leave a Comment