Finding and referencing a second set of data

dudewheresmyvba

New Member
Joined
Jul 6, 2017
Messages
29
I have two sets of data. One offset from the other but directly below it. I want to do things to the second set but do not know how to reference it because they both change per iteration of the data.

So example:
My top set of data is A1:L11.
There are 4 blank rows between them.
And the second set is A16:L46

vs

Top set is A1:L21
4 blank rows
Bottom set is A:26:L155

I want to be able to find and name the range for the bottom set like i did with the top with CurrentRegion.Select. I have been fooling around with the .End(xlUP) but am not quite there.

Let me know if there is any more info you need.
 
Last edited:

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Assuming that your data starts in cell A1 and there is always at least two rows of data in the first section, see if this works for you:
Code:
    Dim myRange As Range
    Set myRange = Range("A1").End(xlDown).End(xlDown).CurrentRegion
    myRange.Select
It will assign the second group to a Range variable named "myRange" which you can then reference in your code.
I added the last line to select it, just to show you visually what range has been assigned to this variable.
 
Upvote 0

Forum statistics

Threads
1,223,248
Messages
6,171,027
Members
452,374
Latest member
keccles

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