Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all
I have written a subroutine to delete all shapes on a sheet but not any DownArrows Sub DeleteShapesExceptDownArrows() Dim MyShape As Object For Each MyShape In ActiveSheet.Shapes If MyShape.Name < msoShapeDownArrow Then MyShape.Delete End If Next MyShape End Sub However, the routine deletes all shapes regardless! Any ideas? -- Regards, Peter Bircher AutomateXcel http://www.automatexcel.co.za/index.html Cell : 083 233 1628 Email: |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The .name property isn't what you want to you. The Name is the string you see
in the namebox (to the left of the formulabar). I'd try: Option Explicit Sub DeleteShapesExceptDownArrows() Dim MyShape As Shape For Each MyShape In ActiveSheet.Shapes If MyShape.AutoShapeType < msoShapeDownArrow Then MyShape.Delete End If Next MyShape End Sub On 02/23/2011 03:53, Pete wrote: Sub DeleteShapesExceptDownArrows() Dim MyShape As Object For Each MyShape In ActiveSheet.Shapes If MyShape.Name < msoShapeDownArrow Then MyShape.Delete End If Next MyShape End Sub -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you so much, Dave.
Been battling with it all day . . . :) Regards, Peter Bircher Cell : 083 233 1628 Email: "Dave Peterson" wrote in message ... The .name property isn't what you want to you. The Name is the string you see in the namebox (to the left of the formulabar). I'd try: Option Explicit Sub DeleteShapesExceptDownArrows() Dim MyShape As Shape For Each MyShape In ActiveSheet.Shapes If MyShape.AutoShapeType < msoShapeDownArrow Then MyShape.Delete End If Next MyShape End Sub On 02/23/2011 03:53, Pete wrote: Sub DeleteShapesExceptDownArrows() Dim MyShape As Object For Each MyShape In ActiveSheet.Shapes If MyShape.Name < msoShapeDownArrow Then MyShape.Delete End If Next MyShape End Sub -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Loop to delete shapes | Excel Programming | |||
Add and delete pictures and shapes | Excel Discussion (Misc queries) | |||
delete drawings in a centain selection | Excel Programming | |||
Delete shapes, not buttons | Excel Programming | |||
Delete Shapes | Excel Programming |