I recorded part of this macro in Excel:
Cells(x, i).Select
Selection.FormulaArray = _
"=SQRT((MMULT(MMULT(TRANSPOSE(R2C14:R9C14),'Monthly Covariance y1'!R[12]C[0]:R[19]C[7]),'Portfolio Vola per Month'!R2C14:R9C14)))"
In the middle term " 'Monthly Covariance y1'!R[12]C[0]:R[19]C[7])" I want to express the bold numbers as variables. 0 should be j and 7 should be j+7.
When I try to replace the hard numbers by variables, Excel returns "Unable to set FormulaArray property of the Range class".
Any idea on how I can work around this problem?
Many thanks.