I'm trying to place values in cells using the Eval function:
With wsCalculations
.Cells(j, i + 1).Value = Eval(ary(1))
End With
However, the thing is this is always returning "#REF!" values. Something I do not expect, as when I MsgBox (Eval(ary(1))) gives me a decimal value. I need to evaluate the value as otherwise I just see a string.
Here's the eval function i'm using:
Function Eval(Ref As String)
Application.Volatile
Eval = Evaluate(Ref)
End Function
What's missing here?
Evaluate actually returns a cell reference, you should explicitly get its value this way: