NativeExcel2 for .NET Developer's Reference

Referring to Cells by using Index numbers

You can use the Cells or Range property to refer to a single cell by using row and column index numbers.

Example

In the following example, Cells[5,2] returns cell B5 on Sheet1. The Value property is then set to 10.

[C#]
//variant 1
book.Worksheets[1].Cells[5,2].Value = 10;
//variant 2
book.Worksheets[1].Range[5,2].Value = 10;
        
[Visual Basic]
'variant 1
book.Worksheets(1).Cells(5,2).Value = 10
'variant 2
book.Worksheets(1).Range(5,2).Value = 10
        
[C++]
//variant 1
book->Worksheets->Item[1]->Cells->Item[5,2]->Value = 10;
//variant 2
book->Worksheets->Item[1]->Range->Item[5,2]->Value = 10;
        

See also

IRange.Item[int, int] Property