method Items.MergeCells ([Cell1 as Variant], [Cell2 as Variant], [Options as Variant])
Merges a list of cells.

TypeDescription
Cell1 as Variant A long expression that indicates the handle of the cell being merged, or a safe array that holds a collection of handles for the cells being merged. Use the ItemCell property to retrieves the handle of the cell. The first cell (in the list, if exists) specifies the cell being displayed in the new larger cell.
Cell2 as Variant A long expression that indicates the handle of the cell being merged, or a safe array that holds a collection of handles for the cells being merged. Use the ItemCell property to retrieves the handle of the cell. The first cell in the list specifies the cell being displayed in the new larger cell.
Options as Variant Reserved.
The MergeCells method combines two or more cells into one cell. The data in the first specified cell is displayed in the new larger cell. All the other cells' data is not lost. Use the CellMerge property to merge or unmerge a cell with another cell in the same item. Use the ItemDivider property to display a single cell in the entire item. Use the UnmergeCells method to unmerge the merged cells. Use the CellCaption property to specify the cell's caption. Use the ItemCell property to retrieves the handle of the cell. Use the BeginMethod and EndUpdate methods to maintain performance, when merging multiple cells in the same time. The MergeCells methods creates a list of cells from Cell1 and Cell2 parameters that need to be merged, and the first cell in the list specifies the displayed cell in the merged cell.

The following sample adds three columns to a group, a root item and few child items:

With ExplorerTree1
    .BeginUpdate
    With .Groups.Add("Group")
        .BeginUpdate
            .Expanded = True
            .AutoHeight = True
            .MarkSearchColumn = False
            .DrawGridLines = exAllLines
            .LinesAtRoot = exLinesAtRoot
            With .Columns.Item(0)
                .Def(exCellCaptionFormat) = exHTML
                .Width = 64
            End With
            .Columns.Add "Column 2"
            .Columns.Add "Column 3"
            .ColumnAutoResize = True
            With .Items
                Dim h As Long
                h = .AddItem("Root. This is the root item")
                .InsertItem h, , Array("Child 1", "SubItem 2", "SubItem 3")
                .InsertItem h, , Array("Child 2", "SubItem 2", "SubItem 3")
                .ExpandItem(h) = True
            End With
        .EndUpdate
    End With
    .EndUpdate
End With

( Notice that the caption of the root item is truncated by the column that belongs to ).

If we are merging the first three cells in the root item we get:

You can merge the first three cells in the root item using any of the following methods: