I'm trying to apply an array formula to a range of cells, however it gives me the classic "Unable to set the FormulaArray property of the Range class" error.
Here is the equation:
The weird thing is, if I take out the = sign before the Sum, then it will paste this formula as text in the cells, and then if I insert an equal sign manually and press ctrl + alt + enter, it works perfectly.
So why isn't it working in VBA then?
Any help is greatly appreciated!
Here is the equation:
Code:
ActiveSheet.Cells(i, 30).FormulaArray = "=Sum(If('" & Path & "\[" & FileName & "]" & SheetName & "'!" & "B5" & ":" & "B371" & "=" & """Mon""" & "," & "'" & Path & "\[" & FileName & "]" & SheetName & "'!" & "T5" & ":" & "T371" & "," & "0" & "))"
The weird thing is, if I take out the = sign before the Sum, then it will paste this formula as text in the cells, and then if I insert an equal sign manually and press ctrl + alt + enter, it works perfectly.
So why isn't it working in VBA then?
Any help is greatly appreciated!