Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
bw bw is offline
external usenet poster
 
Posts: 8
Default Identify Shapes

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)?



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Identify Shapes

One way:

Select the button. Look in the Name box on the left side of the Formula
bar.

In article ,
"bw" wrote:

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)?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default Identify Shapes

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 ***
  #4   Report Post  
Posted to microsoft.public.excel.programming
bw bw is offline
external usenet poster
 
Posts: 8
Default Identify Shapes

Thank you both, JE and Les!
And now I know...
Bernie

"bw" wrote in message
...
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)?





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Identify Shapes

Sub shhapes()
n = ActiveSheet.Shapes.Count
For i = 1 To n
MsgBox (ActiveSheet.Shapes(i).Name)
Next
End Sub

--
Gary''s Student - gsnu200737


"bw" wrote:

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)?




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel document with shapes on it but the shapes do not print [email protected] Excel Worksheet Functions 2 October 22nd 09 06:17 PM
Naming Auto Shapes and Creating new Shapes AL2000 Excel Discussion (Misc queries) 3 September 10th 07 04:12 AM
When drawing shapes in excel the shapes keep disappearing Tape Excel Discussion (Misc queries) 1 October 6th 06 04:23 PM
How can i get more 3D shapes for Auto shapes in excel? Ajey Excel Discussion (Misc queries) 0 March 3rd 05 09:53 AM
How can i get more 3D shapes for Auto shapes in excel? Ajey Excel Discussion (Misc queries) 0 March 3rd 05 09:53 AM


All times are GMT +1. The time now is 03:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"