Rate array formula

I can evaluate the normal Excel formula in VBA , for example:

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

How can I evaluate the array formula?

+4
source share
1 answer

As L42 suggested , you only need to use the string option Evaluateto make it work with array formulas.
For instance,

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

works for you (with corresponding values ​​in G5:G10and F5:F10)?
Some additional information here .

+3
source

Source: https://habr.com/ru/post/1568529/


All Articles