Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete grouped shapes?


Hello

I’m trying to delete grouped shapes objects with name “Group 8”. On the
sheet are also other shape object (not grouped) which I won’t to delete.
The code which I write won’t work. I thing that something is wrong the
name, but I don’t know what. Can you help me.

Sub Delete_shapes()
Dim SHP As Shape
For Each SHP In ActiveSheet.Shape
If Not SHP.Name = "Group 8" Then
SHP.Delete
End If
Next SHP
End Sub

Than you

Drile


--
Dr.Ile
------------------------------------------------------------------------
Dr.Ile's Profile: http://www.excelforum.com/member.php...o&userid=15975
View this thread: http://www.excelforum.com/showthread...hreadid=527961

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Delete grouped shapes?

Hi Dr. Ile,

Your question appears ambiguous.

However, try changing:

For Each SHP In ActiveSheet.Shape


to

For Each SHP In ActiveSheet.Shapes


---
Regards,
Norman



"Dr.Ile" wrote in
message ...

Hello

I'm trying to delete grouped shapes objects with name "Group 8". On the
sheet are also other shape object (not grouped) which I won't to delete.
The code which I write won't work. I thing that something is wrong the
name, but I don't know what. Can you help me.

Sub Delete_shapes()
Dim SHP As Shape
For Each SHP In ActiveSheet.Shape
If Not SHP.Name = "Group 8" Then
SHP.Delete
End If
Next SHP
End Sub

Than you

Drile


--
Dr.Ile
------------------------------------------------------------------------
Dr.Ile's Profile:
http://www.excelforum.com/member.php...o&userid=15975
View this thread: http://www.excelforum.com/showthread...hreadid=527961



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Delete grouped shapes?

Dr.Ile,
From your code it looks like you are trying to delete all shapes except
"Group 8".
Anyway, For Each.. requires a collection, so it is "ShapeS", not "Shape".
You would found an error on this line when you tried to run it.

NickHK

"Dr.Ile" wrote in
message ...

Hello

I’m trying to delete grouped shapes objects with name “Group 8”. On the
sheet are also other shape object (not grouped) which I won’t to delete.
The code which I write won’t work. I thing that something is wrong the
name, but I don’t know what. Can you help me.

Sub Delete_shapes()
Dim SHP As Shape
For Each SHP In ActiveSheet.Shape
If Not SHP.Name = "Group 8" Then
SHP.Delete
End If
Next SHP
End Sub

Than you

Drile


--
Dr.Ile
------------------------------------------------------------------------
Dr.Ile's Profile:

http://www.excelforum.com/member.php...o&userid=15975
View this thread: http://www.excelforum.com/showthread...hreadid=527961



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
Assigning Macros to Grouped Shapes Spinner Excel Programming 0 December 30th 05 03:38 PM
Names of Grouped Shapes Mogwai Excel Programming 11 September 7th 05 05:32 PM
Changing Text in grouped shapes sebastienm Excel Programming 1 August 1st 04 02:54 PM
Delete Shapes acces[_7_] Excel Programming 1 May 7th 04 06:51 PM
How can I loop to find the grouped shapes count David Cuthill Excel Programming 3 January 26th 04 08:22 PM


All times are GMT +1. The time now is 01:51 AM.

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

About Us

"It's about Microsoft Excel"