Mac 上 Excel 2011 的 VBA 中的“=R[-115]C”是什么意思?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29739494/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 09:32:36  来源:igfitidea点击:

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

excel-vbaexcel-vba-macexcel-2011vbaexcel

提问by Waleed

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

=R[-115]C在下面的代码中,Mac 上的 VBA for Excel 2011中的“ ”是什么意思?

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

回答by Comintern

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

这是公式所在单元格的偏移量。您发布的示例...

"=R[-115]C"

"=R[-115]C

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

...将在同一列中偏移 -115 行,因此相当于=F56.

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

您可以对列执行相同的操作。这个...

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

...would give you the formula =B1.

...会给你公式=B1