1

I'm trying to code a variable R1C1 formula but I don't know what I'm doing wrong. I searched a lot but couldn't find any answer applicable to my case.

Sub Step17()
Dim Final As Integer

ActiveCell.FormulaR1C1 = "=SUM(R[4]C:R[&Final&]C)"

End Sub

I created the variable "Final" because what I need to do is a sum of a range where the last row is going to be different every time so it goes from row 4 to row 50 in the first batch but in the following batch it might end up in row 200.

Thanks so much for your help.

Marvin
  • 13,325
  • 3
  • 51
  • 57

0 Answers0