Jim
Jim

Reputation: 11

creating and deleting shapes in vba excel

When creating a shape in excel an automatic name is generated eg "Click Box 213". This would be the 213th shape created. My shapes are created by a macro copying lines in an excel sheet. How to identify the last shape created so I can perform operating on it?

Upvotes: 1

Views: 151

Answers (1)

SierraOscar
SierraOscar

Reputation: 17627

Use the .Count property on the Shapes collection

Set lastShape = ActiveSheet.Shapes(ActiveSheet.Shapes.Count))

Upvotes: 1

Related Questions