Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I recognize shapes?

Status
Not open for further replies.

nimo

Programmer
Apr 26, 2002
20
DE
Hi All

Suppose I have a 15 of shapes (Rectangles, Ovals etc.) . Now I think the shapes are marked as Shapes("Rectangle 1"),Shapes("Rectangle 2"),Shapes("Oval 3") ....serially.........now my question is how can I make a Macro that is intelligent enough to identify the corresponding shape when I click the shape.......like if I click Shapes("Rectangle 1"), it will return me Shapes("Rectangle 1") or at least "Rectangle 1".......
 
You need to look at the AutoShapeType property of the selected shape. You'll need a select case statement to generate the text name of the shape, e.g.

select case activeworksheet.shapes(i)
case msoShapeRectangle:ShapeName="rectangle"
...etc
end select

Rob
 
Hi

Thanx
I think it will return me the type of the shape, right? but I need t´he name of the shape, like "Rectangle 1" or "Rectabgle 4" or "Oval 6" etc...

Is it possible?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top