Shapes In ActiveSheet

T

Tommi

Hello!
Can someone help me how I get all Shapes (which I am using as buttons for
macros) deleted in activesheet.
The problem is that I don't know the name of those Shapes. (There is also
Shapes in other sheets, which should not be deleted)

I thank you for your help!

BR,
Tommi
 
C

Chip Pearson

Tommi,

Try something like

Dim SH As Shape
For Each SH In ActiveSheet.Shapes
SH.Delete
Next SH



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
G

Guest

Tommi,

Try this:

For each shp in ActiveSheet.Shapes
shp.Select
Selection.Delete
Next

Nikos
 
V

Vasant Nanavati

Hi Chip:

Interestingly,

ActiveSheet.Shapes.Delete

does not work, while:

ActiveSheet.DrawingObjects.Delete

does.

Why the difference? Aren't they equivalent? Help seems to refer to
DrawingObjects and Shapes interchangeably.

Regards,

Vasant.
 
D

David McRitchie

Hi Tommi,
Shapes
http://www.mvps.org/dmcritchie/excel/shapes.htm
in case your question was not answered. I think you wanted to
identify the name of a shape.

You shoujld put your name (first & last) even when posting
with anonymous email address at least it is a bit more friendly
most of regulars also do use their real email address and do
deal with the spam to email with filters.

Newsgroup postings are archived, and if I wanted to see if anyone
replied to my post I could put [email protected] or
I could put "David McRitchie" in as author and limit to a date range
to find if anyone replied to my question.
http://www.mvps.org/dmcritchie/excel/xlnews.htm
 
B

Bob Phillips

Absolutely agree, and it seems to be on the increase. It is nice to know who
you are talking to.

Bob

David McRitchie said:
Hi Tommi,
Shapes
http://www.mvps.org/dmcritchie/excel/shapes.htm
in case your question was not answered. I think you wanted to
identify the name of a shape.

You shoujld put your name (first & last) even when posting
with anonymous email address at least it is a bit more friendly
most of regulars also do use their real email address and do
deal with the spam to email with filters.

Newsgroup postings are archived, and if I wanted to see if anyone
replied to my post I could put [email protected] or
I could put "David McRitchie" in as author and limit to a date range
to find if anyone replied to my question.
http://www.mvps.org/dmcritchie/excel/xlnews.htm
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

Tommi,

Try this:

For each shp in ActiveSheet.Shapes
shp.Select
Selection.Delete
Next

Nikos
 
Top