Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Grouped shape name

I know how to use ActiveSheet.Shapes(Application.Caller).Name to get the name
of the shape which is running a macro. BUT! If that shape is a GROUPED
shape, that line runs the name of the individual piece, not the name of the
group. What would I use to show the name of the Group? Or how about show
the name of the group that the particular shape is a member of???

Any thoughts?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Grouped shape name

Sub Shp_click()
MsgBox Application.Caller
MsgBox ActiveSheet.Shapes( _
Application.Caller).ParentGroup.Name
End Sub

--
Regards,
Tom Ogilvy


"Janie" wrote:

I know how to use ActiveSheet.Shapes(Application.Caller).Name to get the name
of the shape which is running a macro. BUT! If that shape is a GROUPED
shape, that line runs the name of the individual piece, not the name of the
group. What would I use to show the name of the Group? Or how about show
the name of the group that the particular shape is a member of???

Any thoughts?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Grouped shape name

I would think it is .parent.name


I added a rectangle and an oval to my worksheet then grouped the items. the
I ran this test code

Sub getdim()

For Each shp In Sheets("sheet1").Shapes
Myname = shp.Name

Next shp

end sub


I only had one shape on my worksheet called group 6
In group 6 I had Item1 and Items.

Item1.name "rectangle 4"
Item2.name "oval 5"

I usually add a watch to my VBA window and then go exploring to find out the
proper way to identify items.

I would do someting like this
set Myshape = ActiveSheet.Shapes("shape Name")
then set a watch on Myshape a see if there is a parent and check the parent
properties.

"Janie" wrote:

I know how to use ActiveSheet.Shapes(Application.Caller).Name to get the name
of the shape which is running a macro. BUT! If that shape is a GROUPED
shape, that line runs the name of the individual piece, not the name of the
group. What would I use to show the name of the Group? Or how about show
the name of the group that the particular shape is a member of???

Any thoughts?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Grouped shape name

Thanks, Tom. That was it! I had tried Parent, but that gives you the name
of the worksheet.

Janie

"Joel" wrote:

I would think it is .parent.name


I added a rectangle and an oval to my worksheet then grouped the items. the
I ran this test code

Sub getdim()

For Each shp In Sheets("sheet1").Shapes
Myname = shp.Name

Next shp

end sub


I only had one shape on my worksheet called group 6
In group 6 I had Item1 and Items.

Item1.name "rectangle 4"
Item2.name "oval 5"

I usually add a watch to my VBA window and then go exploring to find out the
proper way to identify items.

I would do someting like this
set Myshape = ActiveSheet.Shapes("shape Name")
then set a watch on Myshape a see if there is a parent and check the parent
properties.

"Janie" wrote:

I know how to use ActiveSheet.Shapes(Application.Caller).Name to get the name
of the shape which is running a macro. BUT! If that shape is a GROUPED
shape, that line runs the name of the individual piece, not the name of the
group. What would I use to show the name of the Group? Or how about show
the name of the group that the particular shape is a member of???

Any thoughts?

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
Grouped Items won't Stay Grouped When Moving Object Heather02 Excel Discussion (Misc queries) 0 February 12th 09 07:08 PM
my curser changed from arrow shape to a cross shape???? bj New Users to Excel 1 February 5th 07 02:47 PM
Editting textbox value that is grouped with a shape David Cuthill[_2_] Excel Programming 5 June 1st 04 06:39 PM
Deleting a shape and the cell contents the shape is in. Dave Peterson[_3_] Excel Programming 1 October 9th 03 03:36 PM
Deleting a shape and the cell contents the shape is in. Tom Ogilvy Excel Programming 0 October 9th 03 03:43 AM


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

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

About Us

"It's about Microsoft Excel"