ShapeRange.Group (Excel)

Groups the shapes in the specified range.

Because a group of shapes is treated as a single shape, grouping and ungrouping shapes changes the number of items in the Shapes collection and changes the index numbers of items that come after the affected items in the collection. The Range object must be a single cell in the PivotTable field's data range. If you attempt to apply this method to more than one cell, it will fail (without displaying an error message).


Dim shpGroup As Shape
Set shpGroup = ActiveChart.OLEObjects.ShapeRange.Group()