I was just wondering if you could help me better understand what `.Cells(.Rows.Count,"A").End(xlUp).row`

does. I understand the portion before the `.End`

part.

# Excel – Meaning of .Cells(.Rows.Count,”A”).End(xlUp).row

excelvba

Skip to content
# Excel – Meaning of .Cells(.Rows.Count,”A”).End(xlUp).row

###### Related Question

excelvba

`.Cells(.Rows.Count,"A").End(xlUp).row`

does. I understand the portion before the `.End`

part.

## Best Answer

It is used to find the how many rows contain data in a worksheet that contains data in the column "A". The full usage is

Where

`ws`

is a Worksheet object. In the questions example it was implied that the statement was inside a`With`

block`ws.Rows.Count`

returns the total count of rows in the worksheet (1048576 in Excel 2010).`.Cells(.Rows.Count, "A")`

returns the bottom most cell in column "A" in the worksheetThen there is the

`End`

method. The documentation is ambiguous as to what it does.Particularly it doesn't define what a "region" is. My understanding is a region is a contiguous range of non-empty cells. So the expected usage is to start from a cell in a region and find the last cell in that region in that direction from the original cell. However there are multiple exceptions for when you don't use it like that:

`rng.cells(1,1)`

.So

`Range.End`

is not a trivial function.`.row`

returns the row index of that cell.