Forum Discussion
Arcade_Printing
Oct 11, 2023Copper Contributor
trying to record a macro to clear objects
trying to record a macro to clear a portion of a sheet of arrows. i can clear them by this procedure, Home->Find&Select->Select objects->highlight area->Delete->esc. but when i record it in a macro i...
HansVogelaar
Oct 11, 2023MVP
Try this macro:
Sub DeleteShapesInSelection()
Dim wsh As Worksheet
Dim shp As Shape
Application.ScreenUpdating = False
Set wsh = ActiveSheet
For Each shp In wsh.Shapes
If Not (Intersect(shp.TopLeftCell, Selection) Is Nothing Or _
Intersect(shp.BottomRightCell, Selection) Is Nothing) Then
shp.Delete
End If
Next shp
Application.ScreenUpdating = True
End Sub