Macro Range Selection From Top to end?

Hyflex

New Member
Joined
Mar 28, 2011
Messages
40
Currently I'm running simple:
Range("E4:AN25000").Select

But some days it might be from E4 to AN13392 or might be any number...

I want it only to select the right amount of rows but the thing is my excel page has multiple datasets so it might have a section of 50 rows, then 4 row gap, then 25 rows, then 4 row gap.... etc

Any help would be much appreciated.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Have a look at "CurrentRegion" in VBA help.

Gary

Thanks Garry, I tried that this morning on my smaller spreadsheet and it keeps selecting to row 5000 and I have no data there... my smaller spreadsheet has like 500rows...

Any ideas?

Thanks
- Hyflex
 
Upvote 0
Would you like to share your code? For a start, you could probably do without the .select, for instance

Code:
Range("E4:AN25000").copy
copies the data in the range.

For a tighter selection, try:

Code:
Range("E4", Range("AN4").End(xlDown)).Select
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,681
Members
452,937
Latest member
Bhg1984

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