Delete all shapes on the page

Delete all shapes on the page VBA

It’s a simple but useful code to have.

I recommend it for beginners!

The following VBA code will provide you with a way to delete all shapes from your Page.It’s only two lines.

Select & delete all shapes using the SelectAll command

In this case, the code assumes that such a figure was drawn.

Sample Code

Here is an example of using the SelectAll command to select and delete all.

Sub test9()

'Select all shapes on the page
ActiveWindow.SelectAll


'Delete selected shapes
ActiveWindow.Selection.Delete

End Sub

Execution Result

It’s all!

If you use this total erase often, try to register this code by placing a command button at the edge of the page.

That’s very easy.

Yes, and very convenient.

Copied title and URL