评估数组公式 [英] Evaluate an Array Formula

查看:58
本文介绍了评估数组公式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在 VBA 中评估正常的Excel公式,例如:

I can evaluate a normal Excel formula within VBA like:

Sub dural()
    MsgBox Evaluate("SUM(A1:A10)")
End Sub

如何计算数组公式?

推荐答案

L42 所建议,只需使用Evaluate的字符串变体即可使其与数组公式配合使用.
例如,

As suggested by L42, you only have to use the string variant of Evaluate to get it to work with array formulas.
For instance, does

Sub dural()
  MsgBox Evaluate("SUM(A1:A10)")
  MsgBox Evaluate("=SUM(G5:G10-F5:F10)")
  MsgBox [=SUM(G5:G10-F5:F10)]
  MsgBox [Sum(G5:G10-F5:F10)]
End Sub

为您工作(在G5:G10F5:F10中具有适当的值)?
此处.

work for you (with appropriate values in G5:G10 and F5:F10)?
Some further information is here.

这篇关于评估数组公式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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