NativeExcel2 for .Net Developer's Reference

IRange.Item Property (Int32, Int32)

Returns an IRange interface that represents a single cell by using row and column index numbers.

[C#] In C#, this property is the indexer for the IRange class.

[Visual Basic]
DefaultPropertyReadOnlyItem(_
ByValrowAsInteger,_
ByValcolAsInteger_
)AsIRange
[C#]
IRangethis[
introw,
intcol
]{get;}
[C++]
__propertyIRange*get_Item(
introw,
intcol
);
[JScript]
returnValue = IRangeObject.Item( row,col );
-or-
returnValue = IRangeObject( row,col );

[JScript] In JScript, you can use the default indexed properties defined by a type, but you cannot explicitly define your own. However, specifying the expando attribute on a class automatically provides a default indexed property whose type is Object and whose index type is String.

Parameters

row
A number that indicates the row number of the cell you want to access, starting with 1 for the first row in the range.
col
A number that indicates the column number of the cell you want to access, starting with 1 for the first column in the range.

Property Value

Returns an IRange interface.

Example

This example sets the value of cell B10 on the first sheet to 100.

[C#]
book.Worksheets[1].Range[10, 2].Value = 100;
[VisualBasic]
book.Worksheets(1).Range(10, 2).Value = 100
[C++]
book->Worksheets->Item[1]->Range->Item[10, 2]->Value = 100;

See Also

IRange Interface | NativeExcel Namespace | IRange.Item Overload List | How to reference Cells and Ranges | How to reference Cells and Ranges