Skip to content

Latest commit

 

History

History
58 lines (35 loc) · 1.41 KB

Excel.ShapeRange.Ungroup.md

File metadata and controls

58 lines (35 loc) · 1.41 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
ShapeRange.Ungroup method (Excel)
vbaxl10.chm640094
vbaxl10.chm640094
Excel.ShapeRange.Ungroup
d7794250-e4b4-6998-e43d-4b41475ac6c9
05/14/2019
medium

ShapeRange.Ungroup method (Excel)

Ungroups any grouped shapes in the specified shape or range of shapes. Disassembles pictures and OLE objects within the specified shape or range of shapes.

Syntax

expression.Ungroup

expression A variable that represents a ShapeRange object.

Return value

A ShapeRange object that represents the ungrouped shapes.

Remarks

Because a group of shapes is treated as a single object, 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.

Example

This example ungroups any grouped shapes and disassembles any pictures or OLE objects on myDocument.

Set myDocument = Worksheets(1) 
For Each s In myDocument.Shapes 
 s.Ungroup 
Next

This example ungroups any grouped shapes on myDocument without disassembling pictures or OLE objects on the document.

Set myDocument = Worksheets(1) 
For Each s In myDocument.Shapes 
 If s.Type = msoGroup Then s.Ungroup

[!includeSupport and feedback]