Forum Discussion
keldsor
Oct 27, 2022Copper Contributor
Finding type of graphic objects WITHOUT selecting ???
I have a sheet with some rectangles, arrows and triangles. Each rectangle has a number as it's Name and when I want to add new rectangles I need to find the biggest 'number' Name allready used and c...
- Oct 27, 2022
You could use
Sub IdentifyShapes() Dim s As Shape For Each s In ActiveSheet.Shapes Debug.Print s.Name, s.Type, s.AutoShapeType Next s End Sub
For a rectangle, s.Type will be 1 = msoAutoShape, and s.AutoShapeType will be 1 = msoShapeRectangle
HansVogelaar
Oct 27, 2022MVP
You could use
Sub IdentifyShapes()
Dim s As Shape
For Each s In ActiveSheet.Shapes
Debug.Print s.Name, s.Type, s.AutoShapeType
Next s
End Sub
For a rectangle, s.Type will be 1 = msoAutoShape, and s.AutoShapeType will be 1 = msoShapeRectangle
keldsor
Oct 27, 2022Copper Contributor
OK, then I'll have to check for BOTH Type and AutoShapeType (both = 1) for a Ractangle
THX for your time !
THX for your time !