Is Range Offset property needed

W

Walter Briscoe

Yesterday, I found something by accident.
I meant to access the cell above ActiveCell as ActiveCell.Offset(-1, 0).
Instead, I referred to ActiveCell(-1, 0) which seemed to refer to
ActiveCell.Offset(-2, -1).

I thought and concluded ActiveCell is equivalent to ActiveCell(1, 1).

I can now refer to the cell above the current cell as ActiveCell(0, 1).
Is this general?
 
G

GS

Walter Briscoe wrote :
Yesterday, I found something by accident.
I meant to access the cell above ActiveCell as ActiveCell.Offset(-1, 0).
Instead, I referred to ActiveCell(-1, 0) which seemed to refer to
ActiveCell.Offset(-2, -1).

I thought and concluded ActiveCell is equivalent to ActiveCell(1, 1).

I can now refer to the cell above the current cell as ActiveCell(0, 1).
Is this general?

I like to create a fully relative locally defined name "LastCell" so it
will always refer to the cell above the cell using it in a formula.
This is great for cases where calcs change whenever rows are
added/removed, making the formulas somewhat dynamic.

Others I like to use are:

LeftCell,RightCell,LastLeftCell,LastRightCell
NextCell (cell below)
NextLeftCell,NextRightCell

These provide enclosing the active cell in the center of a 9 cell grid.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top