I have 7 columns C to I, all of the same length. I want to enter formulae in rows after the last cell in column I. The formulae include an absolurte cell regerence to the last cell in Column I.
For example, if the last row of column I is row number 12, the formula in cell I13 would be R12C6 + RC[-6]*(R12C7)+R[-12]C[-1], and similarly for the following rows.
However the length of column I can vary, depending on the input data, so the absolute cell reference needs to be variable.
The code I am using for 11 additional rows is:
Sub test1()
Range("I1").End(xlDown'Range("I13").Select
Var = (ActiveCell.Row - 1)
For ltcount = 0 To 11
ActiveCell.Offset(ltcount, 0).FormulaR1C1 = "=R" & Var & " C6 + RC[-6]*(R " & Var & " C7)+R[-12]C[-1]"
Next ltcount
End Sub
When I run this, I get an error, but I can't see what is wrong.
If someone can tell me what I am doing wrong, I would be grateful.
Thanks, any help would be much appreciated
For example, if the last row of column I is row number 12, the formula in cell I13 would be R12C6 + RC[-6]*(R12C7)+R[-12]C[-1], and similarly for the following rows.
However the length of column I can vary, depending on the input data, so the absolute cell reference needs to be variable.
The code I am using for 11 additional rows is:
Sub test1()
Range("I1").End(xlDown'Range("I13").Select
Var = (ActiveCell.Row - 1)
For ltcount = 0 To 11
ActiveCell.Offset(ltcount, 0).FormulaR1C1 = "=R" & Var & " C6 + RC[-6]*(R " & Var & " C7)+R[-12]C[-1]"
Next ltcount
End Sub
When I run this, I get an error, but I can't see what is wrong.
If someone can tell me what I am doing wrong, I would be grateful.
Thanks, any help would be much appreciated