NativeExcel for .Net Developer's Reference

IRange.Row Property

Returns the number of the first row in the range.

[Visual Basic]
PropertyReadOnlyRowAsInteger
[C#]
intRow{get;}
[C++]
__propertyintget_Row();
[JScript]
functiongetRow():int

Example

This example sets the value of A1 cell to the number of the first row in the selection.

[C#]
 IWorksheet sheet = book.Worksheets[1];
 sheet.Range["A1"].Value = sheet.Selection.Row;
[VisualBasic]
 Dim sheet As IWorksheet = book.Worksheets(1)
 sheet.Range("A1").Value = sheet.Selection.Row
[C++]
 IWorksheet* sheet = book->Worksheets->Item[1];
 sheet->Range->Item[S"A1"]->Value = sheet->Selection->Row;

See Also

IRange Interface | NativeExcel Namespace | Selection Property | Column Property