ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   deleting all shapes and lines (https://www.excelbanter.com/excel-programming/344145-deleting-all-shapes-lines.html)

thadpole

deleting all shapes and lines
 
Is there a quick and simple code to delete ALL shapes on a worksheet?
Thanks!

K Dales[_2_]

deleting all shapes and lines
 
Dim ThisShape as Shape
For Each ThisShape in Worksheets("SheetName").Shapes
ThisShape.Delete
Next ThisShape
--
- K Dales


"thadpole" wrote:

Is there a quick and simple code to delete ALL shapes on a worksheet?
Thanks!


thadpole

deleting all shapes and lines
 
Thank you!!! It worked, except it deleted all my buttons on the worksheet
too! I forgot buttons were actually shapes as well.


"K Dales" wrote:

Dim ThisShape as Shape
For Each ThisShape in Worksheets("SheetName").Shapes
ThisShape.Delete
Next ThisShape
--
- K Dales


"thadpole" wrote:

Is there a quick and simple code to delete ALL shapes on a worksheet?
Thanks!


Ron de Bruin

deleting all shapes and lines
 
See the information on this page
http://www.rondebruin.nl/controlsobjectsworksheet.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl


"thadpole" wrote in message ...
Thank you!!! It worked, except it deleted all my buttons on the worksheet
too! I forgot buttons were actually shapes as well.


"K Dales" wrote:

Dim ThisShape as Shape
For Each ThisShape in Worksheets("SheetName").Shapes
ThisShape.Delete
Next ThisShape
--
- K Dales


"thadpole" wrote:

Is there a quick and simple code to delete ALL shapes on a worksheet?
Thanks!




thadpole

deleting all shapes and lines
 
Thanks, that will work too, especially if there are a lot of controls on the
sheet. Fortunately, I only have 2 controls so I inserted a simple...

If ThisShape.Name < "MyButtonName" then
ThisShape.Delete
End If


"Ron de Bruin" wrote:

See the information on this page
http://www.rondebruin.nl/controlsobjectsworksheet.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl


"thadpole" wrote in message ...
Thank you!!! It worked, except it deleted all my buttons on the worksheet
too! I forgot buttons were actually shapes as well.


"K Dales" wrote:

Dim ThisShape as Shape
For Each ThisShape in Worksheets("SheetName").Shapes
ThisShape.Delete
Next ThisShape
--
- K Dales


"thadpole" wrote:

Is there a quick and simple code to delete ALL shapes on a worksheet?
Thanks!






All times are GMT +1. The time now is 03:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com