largeselection
Active Member
- Joined
- Aug 4, 2008
- Messages
- 358
Hi,
So with some help from users on this board I have put together some code which will define a bunch of ranges for me. I need to reference the first, second, third, etc cells in the ranges I've defined now. How can I do that?
As an example: The code might run through the data and say Range1 = Cells(2,3), Cells(5,3), Cells(15,3) and Cells(25,3).
So now I need to be able to refer to first cell in Range1.offset(0,3) in another part of my code, then continue on to say second cell in Range1.offset(0,3) etc.
In my example, that would mean that I would want the code to be able to refer to:
Range1 first = Cells(2,3).offset(0,3)
Range1 Second = Cells(5,3).offset(0,3)
Range1 third = Cells(15,3).offset(0,3)
Range1 fourth = Cells(25,3).offset(0,3)
This is basically so I can pull the value of another cell a few columns over from where the data resides where the range was created.
So with some help from users on this board I have put together some code which will define a bunch of ranges for me. I need to reference the first, second, third, etc cells in the ranges I've defined now. How can I do that?
As an example: The code might run through the data and say Range1 = Cells(2,3), Cells(5,3), Cells(15,3) and Cells(25,3).
So now I need to be able to refer to first cell in Range1.offset(0,3) in another part of my code, then continue on to say second cell in Range1.offset(0,3) etc.
In my example, that would mean that I would want the code to be able to refer to:
Range1 first = Cells(2,3).offset(0,3)
Range1 Second = Cells(5,3).offset(0,3)
Range1 third = Cells(15,3).offset(0,3)
Range1 fourth = Cells(25,3).offset(0,3)
This is basically so I can pull the value of another cell a few columns over from where the data resides where the range was created.