Hi everyone,
I'm new to writing macros and need a little coaching. I'm trying to delete some shapes in a range. The workbook has 12 tabs and the same shapes apprear in each tab. I'm trying to loop the deletion of the shapes for all the tabs.
It errors out at "Intersect"
Sub DELETESHAPERANGE()
Dim ws As Worksheet
Dim s As Shape
For Each ws In ActiveWorkbook.Sheets
For Each s In ws.Shapes
If Not Intersect(s.TopLeftCell, .Range("A1:AZ8")) Is Nothing Then s.Delete
Next s
Next ws
End Sub
Thanks for the help
I'm new to writing macros and need a little coaching. I'm trying to delete some shapes in a range. The workbook has 12 tabs and the same shapes apprear in each tab. I'm trying to loop the deletion of the shapes for all the tabs.
It errors out at "Intersect"
Sub DELETESHAPERANGE()
Dim ws As Worksheet
Dim s As Shape
For Each ws In ActiveWorkbook.Sheets
For Each s In ws.Shapes
If Not Intersect(s.TopLeftCell, .Range("A1:AZ8")) Is Nothing Then s.Delete
Next s
Next ws
End Sub
Thanks for the help
Last edited: