Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default refer to an object in a group

Is that possible to refer to an object in a group

ActiveSheet.Shapes("group_3"...?..."rectangle_4"). Select
or
ActiveSheet.Shapes("group_7"...?..."textbox_3").Te xt= "abc"


thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default refer to an object in a group

Hi,

You can access a shape within a group but not by name.
You have to use a numeric index.

The following should help. Add 3 rectangles to the active sheet and then
group them.

'---------------------------
Sub X()
Dim shpGroup As Shape
Dim shpTemp As Shape
'
Set shpGroup = ActiveSheet.Shapes(1)
If shpGroup.Type = msoGroup Then
For Each shpTemp In shpGroup.GroupItems
Debug.Print "Grouped shape ", shpTemp.Name
Next
With shpGroup.GroupItems(1)
.Fill.ForeColor.RGB = RGB(0, 255, 0)
End With
Else
' normal ungrouped shape
Debug.Print "Shape ", shpGroup.Name
End If
End Sub
'---------------------------

Cheers
Andy

Linda Edlund wrote:
Is that possible to refer to an object in a group

ActiveSheet.Shapes("group_3"...?..."rectangle_4"). Select
or
ActiveSheet.Shapes("group_7"...?..."textbox_3").Te xt= "abc"


thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default refer to an object in a group

Thank you for the answer Andy
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
Possible to refer to a sheet's object name ? kittronald Excel Worksheet Functions 1 August 23rd 11 11:30 PM
make camera object refer to dynamic range Mica Excel Discussion (Misc queries) 0 March 27th 10 12:14 AM
Refer to controls by group name. stewart Excel Programming 2 May 8th 07 12:11 AM
Formula1 Property of Validation Object to refer to function name [email protected] Excel Programming 2 March 30th 06 12:53 AM
More then 1 Excel object running at same time , how can I refer to right one in code? Dave Lauberts Excel Programming 5 October 28th 04 03:57 PM


All times are GMT +1. The time now is 10:58 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"