What does “=R[-115]C” mean in VBA for Excel 2011 o

2019-07-02 01:46发布

What does "=R[-115]C" mean in VBA for Excel 2011 on Mac in below code?

Range("F171").Select    'to select a cell
ActiveCell.FormulaR1C1 = "=R[-115]C"

1条回答
贼婆χ
2楼-- · 2019-07-02 02:25

It's the offset from the cell that the formula is in. The example you posted...

"=R[-115]C"

...would be offset by -115 rows in the same column, so would be equivalent to =F56.

You can do the same thing with the columns. This...

Range("A1").Select
ActiveCell.FormulaR1C1 = "=RC[1]"

...would give you the formula =B1.

查看更多
登录 后发表回答