NativeExcel for .Net Developer's Reference

IRange.Row Property

Returns the number of the first row in the range.

[Visual Basic]
Property ReadOnly Row As Integer
[C#]
int Row { get; }
[C++]
__property int get_Row();
[JScript]
function get Row() : 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;
[Visual Basic]
 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