Discussion:
Identify Shapes
(too old to reply)
bw
18 years ago
Permalink
I recorded a macro and it came up with the following line (among others):
ActiveSheet.Shapes("Button 25").Select

Assuming I have multiple shapes (Buttons) on my worksheet, How do I
determine the name of each Shape ("Button 25" in this case)?
JE McGimpsey
18 years ago
Permalink
One way:

Select the button. Look in the Name box on the left side of the Formula
bar.
Post by bw
ActiveSheet.Shapes("Button 25").Select
Assuming I have multiple shapes (Buttons) on my worksheet, How do I
determine the name of each Shape ("Button 25" in this case)?
Les Stout
18 years ago
Permalink
Hi bw, try the following, it will put the names in column A
Sub test()
'
Dim mySh As Shape
For Each mySh In ActiveSheet.Shapes
Cells(Rows.Count, 1).End(xlUp)(2).Value = mySh.Name
Next mySh
End Sub


Best regards,

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***
bw
18 years ago
Permalink
Thank you both, JE and Les!
And now I know...
Bernie
Post by bw
ActiveSheet.Shapes("Button 25").Select
Assuming I have multiple shapes (Buttons) on my worksheet, How do I
determine the name of each Shape ("Button 25" in this case)?
Gary''s Student
18 years ago
Permalink
Sub shhapes()
n = ActiveSheet.Shapes.Count
For i = 1 To n
MsgBox (ActiveSheet.Shapes(i).Name)
Next
End Sub
--
Gary''s Student - gsnu200737
Post by bw
ActiveSheet.Shapes("Button 25").Select
Assuming I have multiple shapes (Buttons) on my worksheet, How do I
determine the name of each Shape ("Button 25" in this case)?
Loading...