Setting Ranges

TD Rich

Active Member
Joined
Aug 10, 2010
Messages
343
Hello,

I am trying to set a range that will go from cell A2 - the end of the data on the sheet.


Sheets("Approvals").Activate
Range("A2:Selection.End(xlDown").Copy

Can anybody let me know where i am going wrong please?

Thanks for your help.

Regards,

TD Rich.:eek:
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Try

Code:
Sheets("Approvals").Activate
LR = Range("A" & Rows.Count).End(xlUp).Row
Range("A2:A" & LR).Copy
 
Upvote 0
Here's a couple of different ways to select data. To copy the same data just change the ".select" to ".copy":
Code:
'This one selects the whole range from column A:
Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row).Select
'It's from the bottom up so it doesn't stop on blanks

'This one selects the whole used range including other columns:
Range("A2", ActiveSheet.UsedRange.SpecialCells(xlCellTypeLastCell)).Select
'It not only looks for values but any blank cells with some changes made on them
'(ie. font is bold or cell has color, comments or borders on it)

'The following code only selects the area with blank cells around it:
Dim Rng As Range

Set Rng = Range("A2").CurrentRegion
Rng.Offset(1, 0).Resize(Rng.Columns.Count, Rng.Rows.Count - 1).Select
'This one only selects the Range("A2").UsedRegion (without the possible row 1 data).
'I'm using Rng-variable to make it easier to read / understand
'Without the variable I'd have to replace all the Rng:s with the "Range("A2").CurrentRegion":
'Range("A2").CurrentRegion.Offset(1, 0).Resize(Range("A2").CurrentRegion.Columns.Count, Range("A2").CurrentRegion.Rows.Count - 1).Select
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,199
Members
449,072
Latest member
DW Draft

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