Is there any way to find any shapes that have been inserted to a worksheet and then delete them?
P Patrick C. Simonds Dec 4, 2008 #1 Is there any way to find any shapes that have been inserted to a worksheet and then delete them?
D Don Guillett Dec 4, 2008 #2 Sub ShapesCut() For Each s In ActiveSheet.Shapes s.Cut Next End Sub 'or Sub shapescut1() 'Tom Ogilvy ActiveSheet.Shapes.SelectAll Selection.Delete End Sub
Sub ShapesCut() For Each s In ActiveSheet.Shapes s.Cut Next End Sub 'or Sub shapescut1() 'Tom Ogilvy ActiveSheet.Shapes.SelectAll Selection.Delete End Sub
D Dave Peterson Dec 5, 2008 #3 Be careful with shapes. You may not want to delete them all. There are lots of shapes that you may want to keep (comments, autofilter arrows, datavalidation arrows). Ron de Bruin has lots of tips here: http://www.rondebruin.nl/controlsobjectsworksheet.htm
Be careful with shapes. You may not want to delete them all. There are lots of shapes that you may want to keep (comments, autofilter arrows, datavalidation arrows). Ron de Bruin has lots of tips here: http://www.rondebruin.nl/controlsobjectsworksheet.htm
R ryguy7272 Dec 5, 2008 #4 You can try this: Sub CleanRectangles() Dim i As Integer i = 1 Do Until i > 7 Sheets("Sheet1").Rectangles.Delete Sheets("Sheet1").Lines.Delete 'etc., etc., etc., i = i + 1 Loop End Sub Regards, Ryan---
You can try this: Sub CleanRectangles() Dim i As Integer i = 1 Do Until i > 7 Sheets("Sheet1").Rectangles.Delete Sheets("Sheet1").Lines.Delete 'etc., etc., etc., i = i + 1 Loop End Sub Regards, Ryan---
P Peter T Dec 5, 2008 #5 No need for the loop, simply Sheets("Sheet1").DrawingObjects.Delete (won't delete comments or filter arrows) Regards, Peter T
No need for the loop, simply Sheets("Sheet1").DrawingObjects.Delete (won't delete comments or filter arrows) Regards, Peter T