ActiveCell.FormulaR1C1 = "=INDEX(Sales!$B$2:$ZZ$5000,MATCH($A10,Sales!$A$2:$A$5000,0),MATCH(B$9,Sales!$B$1:$ZZ$1,0)))
Can someone please help me with the above? The formula works when I enter it directly into a cell but I can't get it to work when I assign it in vba. I'm sure I'm not using the formula attribute right but can't seem to tweak it to get it to work.
To expand on what I want to do here... I have a sheet that may contain as many as 5000 rows and as many as 400 columns but will usually contain less. What I would like to do is just let the INDEX sit in each cell and only be active when needed but I've found if I fill all these cells with the formula above my computer implodes. Now I'm attempting to use an IF to check whether or not to place the formula in the cell.... Is there a better way.