NativeExcel2 for .Net Developer's Reference

IRange.MergeMethod()

Creates a merged cell from the specified range.

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

Remarks

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

Example

This example merges A1:F1 cells on sheet one.

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

See Also

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