NativeExcel2 for .Net Developer's Reference

IRange.MergeArea Property

Returns an IRange interface that represents the merged range containing the specified cell. If the specified cell isn't in a merged range, this property returns the specified cell.

[Visual Basic]

Property Value

IRange interface.


This example sets the value of the merged range that contains cell A3.

 IRange r = book.Worksheets[1].Range["A3"].MergeArea; 
 r[1,1].Value = String.Format("{0}x{1}", r.Rows.Count, r.Columns.Count);
 Dim r As IRange = book.Worksheets(1).Range("A3").MergeArea
 r(1,1).Value = String.Format("{0}x{1}", r.Rows.Count, r.Columns.Count)
 IRange* r = book->Worksheets->Item[1]->Range->Item[S"A3"]->MergeArea; 
 r->Item[1,1]->Value = String::Format(S"{0}x{1}", r->Rows->Count, r->Columns->Count);

See Also

IRange Interface | NativeExcel Namespace | MergeCells Property