VBA-如何获取公式的结果? (.Value始终返回0) [英] VBA - How to get the result of a formula ? (.Value always returns 0)

查看:840
本文介绍了VBA-如何获取公式的结果? (.Value始终返回0)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获取包含在单元格中的公式的结果,但是我总是返回0,而不是实际结果.

I want to get the result of a formula contained in a cell, but I always get 0 returned, instead of the real results.

我有以下内容:

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

如果 V22 W22 均为零,则

推荐答案

零是正确的答案.

这篇关于VBA-如何获取公式的结果? (.Value始终返回0)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆