I want to move through the cells in a range using an index number (like in a For Next loop) without using a For Each statement. I have a range that is the Union of all the cells identified using the Find method. The variable rAllFound has the address:
There are four cells, as you can see. Once this range is created, I set my variable lCurrent to 1 and that allows me to work with the first cell in the range.
Now I want to increment/decrement lCurrent to use the next cell. I want this:
I get this:
These characteristics of the Range object aren’t surprising, but that doesn’t get me any closer to my goal. I could loop through rAllFound with a For Each and identify the cell I want, but I didn’t like that solution.
You’ll see in my next post that I ended up using FindNext and FindPrevious, which works just fine, but I just can’t believe there’s no way to navigate a non-contiguous range using only an index. I’m sure I’m missing something simple and obvious and I’ll appreciate it if you can set me straight.