0% found this document useful (0 votes)
30 views

Last Row Column

The document provides code to find the last used cell in a column and uses column A as an example. It defines a variable LR to represent the row number of the last used cell. It then uses LR in a range statement to reference cells from A1 to the last row. Another example selects the last non-empty cell in column E.

Uploaded by

Yamini Shinde
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

Last Row Column

The document provides code to find the last used cell in a column and uses column A as an example. It defines a variable LR to represent the row number of the last used cell. It then uses LR in a range statement to reference cells from A1 to the last row. Another example selects the last non-empty cell in column E.

Uploaded by

Yamini Shinde
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Here's a common code to find the last used cell in a column. This will use column A for example...

LR = Cells(Rows.Count, "A").End(xlup).Row

LR is now a variable represinting the Row # of the last used cell in column A
Now you can use that variable in a range statement like this

Range("A1:A" & LR)

Range("E" & Cells.Rows.Count).End(xlUp).Select


will select the last non-empty cell in Col E

Range("E1").Resize(Cells(Rows.Count,"E").End(xlUp).Row,1).Select

You might also like