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

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
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
You are welcome!
 
Upvote 0

Forum statistics

Threads
1,215,461
Messages
6,124,957
Members
449,200
Latest member
indiansth

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