VBA中的范围不接受双重声明价值吗?
我有以下代码,其中我从命名范围中选择一个值,然后将其存储在称为双重的变量中。后来,更改变量后,我想将其重新分配到命名范围。但是在这里,我遇到了溢出错误。如果我将变量更改为整数,则错误会消失。有关信息,我正在使用Mac。
'''
Dim maxDepth As Double
i=0
Do Until Range("scopeID").offset(i, 0) = ""
maxDepth = Range("currentDepth").offset(i, 0)
' some code here that possibly changes the value based on some conditions
Range("currentDepth").offset(i, 0) = maxDepth
i = i + 1
Loop
'''
I have the following code where I pick a value from a named range and store it in a variable declared as a Double. Later on, after changing the variable or not I want to reassign it to the named range. But here I get an Overflow error. The error disappears if I change the variable into an Integer. For information, I am working on a Mac.
'''
Dim maxDepth As Double
i=0
Do Until Range("scopeID").offset(i, 0) = ""
maxDepth = Range("currentDepth").offset(i, 0)
' some code here that possibly changes the value based on some conditions
Range("currentDepth").offset(i, 0) = maxDepth
i = i + 1
Loop
'''
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论