I am trying to copy a really long excel formula
=IF(D22117=1,INDEX(Returns!$E$2:$P$34438,MATCH(A22116&E22116,Returns!$A$2:$A$34438&Returns!$D$2:$D$34438,0),11),IF(D22117=2,INDEX(Returns!$E$2:$P$34438,MATCH(A22115&E22115,Returns!$A$2:$A$34438&Returns!$D$2:$D$34438,0),12),INDEX(Returns!$E$2:$P$34438,MATCH(A22117&E22117,Returns!$A$2:$A$34438&Returns!$D$2:$D$34438,0),D22117-2)))
which cannot be copied with the FormulaArray function anymore which is necessary for the { } brackets around the formula to be included so that i can work. Afterwards i only save the value in the cell, but not the formula. I have another formula that is only a bit shorter which works fine.
This is the macro script for copying
The formula above is in ii,8
Cells(ii, 8).Activate
Formula2 = ActiveCell.FormulaR1C1
Cells(i, 8).Activate
ActiveCell.FormulaArray = Formula2
ret3 = ActiveCell.Value
ActiveCell.Value = ret3
Bookmarks