LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Names of Grouped Shapes

Hi there,

I have quite a few groups with the same number *and name* of Shapes
within, exactly like so:

"Group 1" has "Shape 1", "Shape 2", "Shape 3"
"Group 2" has "Shape 1", "Shape 2", "Shape 3"

I assigned Daves code (below) to each and every Shape. However, if I
click on a Shape in "Group 2" Excel reports that the Shape is part of
"Group 1"

I assume this is due to Shapes in "Group 2" having the same name as
Shapes in "Group 1", but is there any way I can get the correct Group
name for the Shape within?

Thanks

Sub TestSub()
Dim myShape As Shape
Dim i As Long
Dim FoundIt As Boolean
Dim itemCount As Long

FoundIt = False
For Each myShape In ActiveSheet.Shapes
itemCount = 0
On Error Resume Next
itemCount = myShape.GroupItems.Count
On Error GoTo 0
If itemCount 0 Then
For i = 1 To myShape.GroupItems.Count
If myShape.GroupItems(i).Name = Application.Caller Then

MsgBox myShape.GroupItems(i).Name & vbLf &
myShape.Name
myShape.Select
FoundIt = True
Exit For
End If
Next i
If FoundIt Then
Exit For
End If
Else
If myShape.Name = Application.Caller Then
myShape.Select
Exit For
End If
End If
Next myShape
End Sub

 
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
Grouped Items won't Stay Grouped When Moving Object Heather02 Excel Discussion (Misc queries) 0 February 12th 09 07:08 PM
Selecting shapes with unknown names JBCI Excel Discussion (Misc queries) 0 March 10th 08 05:45 PM
Names of Shapes Michael Singmin Excel Programming 5 October 23rd 04 05:35 PM
Changing Text in grouped shapes sebastienm Excel Programming 1 August 1st 04 02:54 PM
How can I loop to find the grouped shapes count David Cuthill Excel Programming 3 January 26th 04 08:22 PM


All times are GMT +1. The time now is 07:02 AM.

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"