Condividi tramite


Worksheet.Rows Property

Definition

Gets a Range object that represents one or more rows on the worksheet.

public:
 property Microsoft::Office::Interop::Excel::Range ^ Rows { Microsoft::Office::Interop::Excel::Range ^ get(); };
public Microsoft.Office.Interop.Excel.Range Rows { get; }
member this.Rows : Microsoft.Office.Interop.Excel.Range
Public ReadOnly Property Rows As Range

Property Value

A Range object that represents one or more rows on the worksheet.

Remarks

When used without parameters, this property returns a Range object that contains all the rows on the worksheet.

This property can be used with the following optional parameters to get specific rows on the worksheet. If you use this property with parameters, the return value is an object that must be cast to a Range.

Parameter Description
RowIndex The index of one or more rows to get.

To get a single row, pass an integer that specifies the index of the row you want to get. The row indexes begin at 1.

To get multiple contiguous rows, pass a string with the format "first row:last row". For example, to get rows 1 through 5, pass "1:5".
ColumnIndex Do not use this parameter. This property will throw a COMException if you try to pass a value to this parameter.

Applies to