Skip to content

Latest commit

 

History

History
64 lines (45 loc) · 1.9 KB

Excel.GroupShapes.md

File metadata and controls

64 lines (45 loc) · 1.9 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
GroupShapes object (Excel)
vbaxl10.chm641072
vbaxl10.chm641072
Excel.GroupShapes
252d35da-9ab4-97f4-1e00-48ccfc003534
03/30/2019
medium

GroupShapes object (Excel)

Represents the individual shapes within a grouped shape.

Remarks

Each shape is represented by a Shape object. Using the Item method with this object, you can work with single shapes within a group without having to ungroup them.

Example

Use the GroupItems property of the Shape object to return the GroupShapes collection.

Use GroupItems (index), where index is the number of the individual shapes within the grouped shape, to return a single shape from the GroupShapes collection.

The following example adds three triangles to myDocument, groups them, sets a color for the entire group, and then changes the color for the second triangle only.

Set myDocument = Worksheets(1) 
With myDocument.Shapes 
 .AddShape(msoShapeIsoscelesTriangle, _ 
 10, 10, 100, 100).Name = "shpOne" 
 .AddShape(msoShapeIsoscelesTriangle, _ 
 150, 10, 100, 100).Name = "shpTwo" 
 .AddShape(msoShapeIsoscelesTriangle, _ 
 300, 10, 100, 100).Name = "shpThree" 
 With .Range(Array("shpOne", "shpTwo", "shpThree")).Group 
 .Fill.PresetTextured msoTextureBlueTissuePaper 
 .GroupItems(2).Fill.PresetTextured msoTextureGreenMarble 
 End With 
End With

Methods

Properties

See also

[!includeSupport and feedback]