I have a spreadsheet with an autoshape that has been pasted over itself approximately 10,000 times. I need to delete all of them. The name of the shape is "Autoshape 10203", "Autoshape 10202" etc.
I have a spreadsheet with an autoshape that has been pasted over itself approximately 10,000 times. I need to delete all of them. The name of the shape is "Autoshape 10203", "Autoshape 10202" etc.
This macro removes all shapes in the entire workbook
Code:
Sub Rem_Shapes()
Dim sh As Shape
Dim ws As Worksheet
For i = 1 To ThisWorkbook.Sheets.Count
Set ws = Sheets(i)
For Each sh In ws.Shapes
sh.Delete
Next sh
Next i
End Sub
If you want to remove items with the name AutoShape in them then replace sh.delete with
We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel
Which adblocker are you using?
Disable AdBlock
Follow these easy steps to disable AdBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the icon in the browser’s toolbar. 2)Click on the "Pause on this site" option.
Go back
Disable AdBlock Plus
Follow these easy steps to disable AdBlock Plus
1)Click on the icon in the browser’s toolbar. 2)Click on the toggle to disable it for "mrexcel.com".
Go back
Disable uBlock Origin
Follow these easy steps to disable uBlock Origin
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.
Go back
Disable uBlock
Follow these easy steps to disable uBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.