我想获得单元格中包含的公式的结果,但我总是得到0返回,而不是实际结果。VBA - 如何获得公式的结果? (.Value总是返回0)
我有以下几点:
Set c = .Cells (5,5)
MsgBox (c.Formula) ' this return the following: = ASIN (W22-V22/$D$7)*180/PI()
MsgBox (c.Value) ' this returns 0
MsgBox (c.Value2) ' this returns 0 as well
即使我尝试与评估:
evaluation = Application.Evaluate (c.Formula)
MsgBox (c.Value) ' it still returns 0
我测试此代码,它为我工作得很好。 – 2015-03-03 12:49:05