MergeCells class

Office 2013 and later

Defines the MergeCells Class. When the object is serialized out as xml, its qualified name is x:mergeCells.

Namespace:  DocumentFormat.OpenXml.Spreadsheet
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

No code example is currently available or this language may not be supported.

[ISO/IEC 29500-1 1st Edition]

mergeCells (Merge Cells)

This collection expresses all the merged cells in the sheet.

[Example:

This example shows that three ranges are merged. The formatting and content for the merged range is always stored in the top left cell.

<mergeCells>
  <mergeCell ref="C2:F2"/>
  <mergeCell ref="B19:C20"/>
  <mergeCell ref="E19:G19"/>
</mergeCells>

end example]

Parent Elements

worksheet (§18.3.1.99)

Child Elements

Subclause

mergeCell (Merged Cell)

§18.3.1.54

Attributes

Description

count (Count)

A count of merged cell collections.

The possible values for this attribute are defined by the W3C XML Schema unsignedInt datatype.

[Note: The W3C XML Schema definition of this element’s content model (CT_MergeCells) is located in §A.2. end note]

© ISO/IEC29500: 2008.

The following code example merges two adjacent cells in an existing spreadsheet. After you run the example, take a look at the file and notice the merged cells.

No code example is currently available or this language may not be supported.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show: