vba delete all shape in Excel

Q190. In Excel, how can I delete all shapes in a WorkSheet?

To do it in Excel, here is the answer:

  1. Option Explicit
  2. Sub DeleteShapes()
  3. Dim shp As Shape
  4. ''
  5. 'Loop through all Shapes in ActiveSheet and delete each one.
  6. For Each shp In ActiveSheet.Shapes
  7. shp.Delete
  8. Next shp
  9. End Sub


a) Lines 6-8 - Loop through all Shapes in ActiveSheet and delete each Shape.


You can find similar Excel Questions and Answer hereunder

1) How can I prevent users from seeing / accessing my macro code?

2) How can I copy and rename a WorkSheet using VBA?

3) How can I sort data using VBA?

4) How can I set the fill color, font color and set number format of cell to date?

5) How do I copy a Table from one location to another and retain all formulas, formats and columnwidths?

6) How can I hide Formula Bar and Headings using VBA?

7) I have several pictures that are misaligned - manually aligning them is very laborious. Is there an automatic alignment option?

8) How to add a link in a sheet to another sheet

9) How can I hide a specific Shape in my WorkSheet?

10) How can I check if a file exists in a folder using VBA?

11) How can I remove display of Gridlines in my worksheet using VBA?

12) How can I set the Source Data of charts using VBA?

13) Vba to return week numbers in Excel

14) How can I dynamically add a hyperlink using VBA?

15) How to change desktop background in Excel