Hi. I am stumped on how to write code that will enter the formula I need into a cell. The formula basically needs to sum every other cell up to a certain number of cells based on a variable that the user inputs. I hope that makes sense. It should look like this except the highest number, in this case 14, is actually a variable called iWeeks.
Thanks!
Code:
ActiveCell.FormulaR1C1 = _
"=SUM(RC[-14],RC[-12],RC[-10],RC[-8],RC[-6],RC[-4],RC[-2])"
Thanks!