VBA – 如何获得一个公式的结果? (.Value总是返回0)

我想获得一个单元格中包含的公式的结果,但我总是得到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 

如果V22W22均为零,则零是正确的答案。

也许试试这个:

 Sub formVal() Dim c As Range Set c = ThisWorkbook.Sheets(1).Cells(5, 5) MsgBox (c.Formula) MsgBox (c.Value) MsgBox (c.Value2) End Sub