Create Loop Code

Hey everybody, I want to create a code that does the same for all my 1300 firms in the sample. The problem is that some cells are supposed to stay the same, but that others are supposed to go down one row with every iteration.

Sheets("Final Sample").Select
FinalRow = Selection.End(xlDown).row
For x = 2 To FinalRow
ActiveCell.FormulaR1C1 = "=RC[-3]-'Final Sample'!r2c7+1"
Selection.AutoFill Destination:=Range("F3:F63842")
Next x

End Sub

Where it says "r2c7" I need it to be r3c7 in the next iteration and so on, so that the cell reference goes down one rown every time. I thought of something like an x (rxc7), but I did not know the syntax. If that's not possible with an x, I am open to suggestions... It should be really easy right? Thank you in advance.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!