Use END to select range with data with a Macro?

Cosmos75

Active Member
Joined
Feb 28, 2002
Messages
359
I have a range with data in range A1:H20. I am trying to make a macro which will select this range which may have rows added to it, but never columns added to it. (i.e, it’ll always start with A1 and end with column H, but the last row may changes).

Is there a way to write a marco to do this? And then once it’s selected that range, I want to be able to Copy it or Make it the Print Area.

THANKS!
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
On 2002-03-06 14:05, Cosmos75 wrote:
I have a range with data in range A1:H20. I am trying to make a macro which will select this range which may have rows added to it, but never columns added to it. (i.e, it’ll always start with A1 and end with column H, but the last row may changes).

Is there a way to write a marco to do this? And then once it’s selected that range, I want to be able to Copy it or Make it the Print Area.

THANKS!

This will copy the range:

Range("A1", Range("H65536").End(xlUp).Address).Copy

You'll just have to put in where you want to paste it. You can use variations of that to select and/or set print area.

Hope this helps,
 
Upvote 0

Forum statistics

Threads
1,214,923
Messages
6,122,286
Members
449,076
Latest member
kenyanscott

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