问题
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:
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
.
来源:https://stackoverflow.com/questions/29739494/what-does-r-115c-mean-in-vba-for-excel-2011-on-mac