Name

range.Item(RowIndex, [ColumnIndex])

Synopsis

Returns a Range object representing a cell within the specified range.

Argument

Settings

RowIndex

The row index of the row to return, relative to the first cell of the range

ColumnIndex

The column index of the column to return, relative to the first cell of the range

The following code changes the color of the cell in the second row and column of the range to green:

Dim r As Range
 
Set r = ActiveSheet.Range("A1:B5")
r.Item(2, 2).Interior.ColorIndex = 4

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.