NativeExcel2 for .Net Developer's Reference

IRangeColumns.MergeMethod

Merges cells in each column of 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 cells in each column of the range A1:F20 on sheet one.

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

See Also

IRangeColumns Interface | NativeExcel Namespace | Merge | IRangeRows.Merge Method | IRange.Merge Method | IRange.UnMerge Method | IRange.MergeCells Property