Select Range with Last Cell in Column with Data

HELP PLEASE

Board Regular
Joined
Jan 8, 2005
Messages
156
I need a code that will select a range of cells...from cell A2 to the last cell with data in column AZ.

Thanks a lot.
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
you can do it with this

Code:
Dim LR as Long
LR = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
Range("A2:AZ"& LR).Select

althought you do not need to generally select data, you would want to do something with the range, like copy
Range("A2:AZ" & LR).Copy
 
Upvote 0
you just want that cell only?

Range("AZ"& LR).Select

this will select only that cell

oh and also this code deteremines the last cell as laid out by the first column
LR = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row

so if column A is not the best column, change the ", 1" to the column that works best for you.
 
Upvote 0

Forum statistics

Threads
1,203,350
Messages
6,054,905
Members
444,760
Latest member
TeckTeck

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top