Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Delete all drawings/shapes except DownArrows

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 420
Default Delete all drawings/shapes except DownArrows

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loop to delete shapes Daniel Bonallack Excel Programming 8 May 28th 09 06:06 AM
Add and delete pictures and shapes jlclyde Excel Discussion (Misc queries) 2 October 22nd 08 02:54 PM
delete drawings in a centain selection bartman1980 Excel Programming 4 October 26th 07 11:23 AM
Delete shapes, not buttons ewan7279 Excel Programming 3 July 17th 07 12:00 PM
Delete Shapes acces[_7_] Excel Programming 1 May 7th 04 06:51 PM


All times are GMT +1. The time now is 09:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"