vba Excel 公式中的“$”是什么意思?例如:$B$4
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24402983/
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
What does '$' mean in Excel formula? e.g: $B$4
提问by clintgh
What does $B$4
mean in Excel?
Here's a sample code:
$B$4
在Excel中是什么意思?
这是一个示例代码:
Cells(7, 15).Value = "=0.1*$B*M7*N7"
and
和
Cells(7, 17).Value = "=P7*1.3*$B"
回答by parakmiakos
The $
sign causes the cell column or row or both in a formula to be fixed.
该$
符号会导致公式中的单元格列或行或两者都被固定。
That is, if you drag the formula cell horizontally or vertically in order to copy the formula, Excel will not adjust this value.
也就是说,如果您水平或垂直拖动公式单元格以复制公式,Excel 将不会调整此值。
For example :
例如 :
Cell Formula
A0 =$B4
If I drag this horizontally I will get :
如果我水平拖动它,我会得到:
Cell Formula
B0 =$B4
C0 =$B4
If I drag this vertically I will get :
如果我垂直拖动它,我会得到:
Cell Formula
A1 =$B5
A2 =$B6
Without the dollar sign :
没有美元符号:
If I drag this horizontally I will get :
如果我水平拖动它,我会得到:
Cell Formula
B0 =C4
C0 =D4
If I drag this vertically I will get :
如果我垂直拖动它,我会得到:
Cell Formula
A1 =B5
A2 =B6
回答by Alexandru Cimpanu
The dollar sign allows you to fix either the row, the column or both on any cell reference, by preceding the column or row with the dollar sign.
美元符号允许您在任何单元格引用上固定行、列或两者,方法是在列或行之前加上美元符号。
In your example you fix the column to Band the row to 4because you probably want to take in consideration only that cell for your formula.
在您的示例中,您将列固定为B,将行固定为4,因为您可能只想为公式考虑该单元格。