NativeExcel2 for .Net Developer's Reference

IRange.MergeMethod(Boolean)

Creates a merged cell from the specified range.

[Visual Basic]
SubMerge(_
ByValAccrosAsBoolean_
)
[C#]
voidMerge(
boolAccros
);
[C++]
voidMerge(
boolAccros
);
[JScript]
functionMerge(
boolAccros
);

Parameters

Accros
True to merge cells in each row of the specified range as separate merged cells.

Remarks

The value of a merged range is specified in the cell of the range's upper-left corner.

Example

This example merges cells in each row of the range A1:F20 on sheet one.

[C#]
 book.Worksheets[1].Range["A1:F20"].Merge(true);
[VisualBasic]
 book.Worksheets(1).Range("A1:F20").Merge(True)
[C++]
 book->Worksheets->Item[1]->Range->Item[S"A1:F20"]->Merge(true);

See Also

IRange Interface | NativeExcel Namespace | IRange.Merge Overload List | UnMerge Method | MergeCells Property | MergeArea Property