0

Basically here's the snippet that doesn't work:

Range("AL2").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=AVERAGE(R[" + CStr(3814 - 30) + "]C[-9]:R[" + CStr(3814) + "]C[-9])"

I would expect cell AL2 to read : "=AVERAGE(AC3784:AC3814)" but instead it reads "=AVERAGE(AC3786:AC3816)"

Why are the numbers 2 larger than I expected? Does it have to do with the selected range being row 2?

Curtis
  • 253
  • 4
  • 11
  • 1
    by using the `[]` you are using relative references which mean the row will be `3814` rows below where it is being placed or `2+3814` which is `3816` the first row with those number should be `3786` for the same reason. – Scott Craner Feb 08 '21 at 23:25
  • 1
    if you want it absolute then remove the `[]` and it will use the number provided as the absolute reference. – Scott Craner Feb 08 '21 at 23:36

0 Answers0