I keep getting an error at that line when running my vba code. The error says "run time error '1004': application defined or object defined error." The code on that row is
Formula:
ActiveCell.Formula2R1C1 = _
"=SUM(SUMIF('Line 1'!R3C1:R16C[-1],INDEX(Product[Prod],AGGREGATE(15,6,1/(Product[Group]=RC1)*ROW(Product[Group]),ROW(INDEX(C1,1):INDEX(C1,COUNT(1/(Product[Group]=RC1)*ROW(Product[Group])))))),'Line 1'!R3C2:R16C2))"
This is code is repeated over 30 times in my code. I'm sure there's a more efficient way of doing this but I found that whenever I run my macro, it deleted the formulas from my other cells so I thought it would be best to just include the formula in my code. Any help on this topic would be much appreciated. Thanks in advance!
Bookmarks