excel-formula - 计算后查看单元格地址
问题描述
我已经构建了如下宏,并且运行良好。但是,我对此有疑问。我想看看每个单元格中的计算是如何执行的,例如原始 excel 文件中的“$B$6+A6”格式,但我无法这样做。如果你能帮我解决这个问题,那就太好了。
非常感谢
Sub RCinput()
Dim a As Long
Dim b As Long
Dim c As Long
Dim d As Long
Dim e As Long
a = InputBox("What is the row number: ")
b = InputBox("What is the column number: ")
c = InputBox("What is the last row number: ")
e = b - 1
For d = a To c
Cells(d, b).Formula = Cells(d, e).Value * 2
Next
End Sub
解决方案
据我所知,您的公式等于值,因此您会收到一个数字。请尝试像这样修改您的代码:
Sub RCinput()
Dim a As Long
Dim b As Long
Dim c As Long
Dim d As Long
Dim e As Long
a = InputBox("What is the row number: ")
b = InputBox("What is the column number: ")
c = InputBox("What is the last row number: ")
e = b - 1
For d = a To c
Cells(d, b).Formula = "=" & Cells(d, e).Address & "* 2"
Next
End Sub
部分Cells(d, b).Formula = "=" & Cells(d, e).Address & "*2"
将放入Cells(d,b)
一个公式,例如"=$A$1*2"
推荐阅读
- knockout.js - foreach 绑定不会为单击应用父上下文
- csv - SAS Proc 导入 CSV 和缺失数据
- amazon-web-services - AWS rekognition:如何处理输出
- node.js - 是否可以从在 Linux 上运行的 nodejs 应用程序以 Windows 身份验证模式连接到 mssql?
- c# - 使用 Azure Http 触发器函数应用将 Cosmos DB 与 OData 集成
- python - 仅当它们包含粗体元素时如何提取html段落元素
- excel - if then elseif then 错误语句 excel vba
- android - Trouble Using Edit Search Function in Recycler View with Cards
- android - Tensorflow Lite 2.0+ 中 bindGlBufferToTensor 的任何替代方法?
- laravel - Laravel Forge - 通过裸 IP 而不是域名访问应用程序