Sheets("Reports").Range("A4:A8")
is returning a Range
object, and you can reference cells in relation to that range. For instance, if you put a sample bit of text in the cell above your header, and you try MsgBox Category(-1)
, it will show that value.
Have a look at this: http://msdn.microsoft.com/en-us/library/office/ff841096%28v=office.15%29.aspx
Because Item
is the default property on the Range
class, you can reference it without explicitly using Range.Item
(e.g. Category(0)
in your example is the same as Category.Item(0)
)
The Item
property -- whether supplied explicitly as in Category.Item(0)
, or, in your case, implicitly as in Category(0)
returns another range representing the cell whose address is relative to your range. That's why if you run my test and call MsgBox Category(-1)
with a sample text in cell A2, it will show that text.
FYI: If you want to proof that Category(0)
is actually itself a range, run MsgBox TypeName(Category.Cells(0))