Compartilhar via


Range.Item Property

Returns a Range object that represents a range at an offset to the specified range.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Property Item ( _
    RowIndex As Object, _
    ColumnIndex As Object _
) As Object
    Get
    Set
'Usage
Dim instance As Range
Dim RowIndex As Object
Dim ColumnIndex As Object
Dim value As Object

value = instance.Item(RowIndex, ColumnIndex)

instance.Item(RowIndex, ColumnIndex) = value
Object this[
    Object RowIndex,
    Object ColumnIndex
] { get; set; }

Parameters

  • RowIndex
    Type: System.Object

    Required Object. The index number of the cell you want to access, in order from left to right, then down. Range.Item(1) returns the upper-left cell in the range; Range.Item(2) returns the cell immediately to the right of the upper-left cell.

  • ColumnIndex
    Type: System.Object

    Optional Object. A number or string that indicates the column number of the cell you want to access, starting with either 1 or "A" for the first column in the range.

Property Value

Type: System.Object

Remarks

The RowIndex and ColumnIndex arguments are relative offsets. In other words, specifying a RowIndex of 1 returns cells in the first row of the range, not the first row of the worksheet.

See Also

Reference

Range Interface

Range Members

Microsoft.Office.Interop.Excel Namespace