For example, in the code below, Item
and Cells
can be used interchangeably:
Dim rRange As Range
Set rRange = ThisWorkbook.ActiveSheet.Range("A1")
With rRange
Debug.Print .Item(1, 1).Value ' Outputs value of "A1"
Debug.Print .Cells(1, 1).Value ' Outputs value of "A1"
Debug.Print .Item(2, 1).Value ' Outputs value of "A2"
Debug.Print .Cells(2, 1).Value ' Outputs value of "A2"
End With
In the developer reference, they are defined as:
Returns a Range object that represents a range at an offset to the specified range.
~
Returns a Range object that represents the cells in the specified range.
Remarks
Because the Item property is the default property for the Range object, you can specify the row and column index immediately after the Cells keyword.
From that remark, does it mean that Cells(1, 1)
is actually a short for Cells.Item(1, 1)
? Thus Cells(1, 1)
is actually equivalent to Item(1, 1)
? What am I missing?