Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Finding a Shape
Is there any way to find any shapes that have been inserted to a worksheet
and then delete them? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Finding a Shape
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 -- Don Guillett Microsoft MVP Excel SalesAid Software "Patrick C. Simonds" wrote in message ... Is there any way to find any shapes that have been inserted to a worksheet and then delete them? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Finding a Shape
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 he http://www.rondebruin.nl/controlsobjectsworksheet.htm "Patrick C. Simonds" wrote: Is there any way to find any shapes that have been inserted to a worksheet and then delete them? -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Finding a Shape
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--- -- RyGuy "Don Guillett" wrote: 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 -- Don Guillett Microsoft MVP Excel SalesAid Software "Patrick C. Simonds" wrote in message ... Is there any way to find any shapes that have been inserted to a worksheet and then delete them? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Finding a Shape
No need for the loop, simply
Sheets("Sheet1").DrawingObjects.Delete (won't delete comments or filter arrows) Regards, Peter T "ryguy7272" wrote in message ... 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--- -- RyGuy "Don Guillett" wrote: 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 -- Don Guillett Microsoft MVP Excel SalesAid Software "Patrick C. Simonds" wrote in message ... Is there any way to find any shapes that have been inserted to a worksheet and then delete them? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Evaluating if a Shape is a line or a shape | Excel Programming | |||
my curser changed from arrow shape to a cross shape???? | New Users to Excel | |||
Why can't I delete this shape now? | Excel Programming | |||
Deleting a shape and the cell contents the shape is in. | Excel Programming | |||
Deleting a shape and the cell contents the shape is in. | Excel Programming |