Absolute Reference to the Left Until Change in Row
I am aware of a few ways to reference a cell to the left of the active cell,
such as:
=INDIRECT("RC[-1]",0)
=OFFSET(B1,-1,0)
I am curious to know if there is a way to link to this cell as an absolute
reference, such as being in cell B1, and referencing $A$1, and then moving
down to the next cell, by means of:
ActiveCell.Offset(1, 0).Select
€¦and continuing in this fashion while checking values in Column A:
If ActiveCell.Offset(0, -1) = ActiveCell.Offset(-1, 1) Then
€˜do stuff here =INDIRECT("RC[-1]",0)
€˜do stuff here =OFFSET(B1,-1,0)
If ActiveCell.Offset(0, -1) < ActiveCell.Offset(-1, 1) Then
€˜ stop the OFFSET function or INDIRECT function, and make new absolute
reference to left of the currently active cell.
I am having a difficult time getting the getting the absolute reference to
stick in VBA, and then getting it to return to a relative reference when:
Offset(0, -1) < Offset(-1, 1)
Does anyone have any ideas about this?
Thanks a bunch!
Ryan--
|