hi there. I got the following vba to insert a formular onto 30 sheets in specified ranges.
For k = 2 To 31
(when k=2)
Sheets(k).Range("F22").FormulaR1C1 = "='Info Sheet'!R[-20]C[38]"
Sheets(k).Range("F23").FormulaR1C1 = "='Info Sheet'!R[-21]C[39]"
Sheets(k).Range("F25").FormulaR1C1 = "='Info Sheet'!R[-23]C[40]"
Sheets(k).Range("F26").FormulaR1C1 = "='Info Sheet'!R[-24]C[41]"
Sheets(k).Range("F28").FormulaR1C1 = "='Info Sheet'!R[-26]C[42]"
Sheets(k).Range("F31").FormulaR1C1 = "='Info Sheet'!R[-29]C[43]"
Next
However, how can I make it to something like this so that the formular will refer to the cell of next row in sheet "Info Sheet" :
when k=3
Sheets(k).Range("F22").FormulaR1C1 = "='Info Sheet'!R[-19]C[38]"
Sheets(k).Range("F23").FormulaR1C1 = "='Info Sheet'!R[-20]C[39]"
Sheets(k).Range("F25").FormulaR1C1 = "='Info Sheet'!R[-22]C[40]"
Sheets(k).Range("F26").FormulaR1C1 = "='Info Sheet'!R[-23]C[41]"
Sheets(k).Range("F28").FormulaR1C1 = "='Info Sheet'!R[-25]C[42]"
Sheets(k).Range("F31").FormulaR1C1 = "='Info Sheet'!R[-28]C[43]"
Any advice, please
Thanks.
For k = 2 To 31
(when k=2)
Sheets(k).Range("F22").FormulaR1C1 = "='Info Sheet'!R[-20]C[38]"
Sheets(k).Range("F23").FormulaR1C1 = "='Info Sheet'!R[-21]C[39]"
Sheets(k).Range("F25").FormulaR1C1 = "='Info Sheet'!R[-23]C[40]"
Sheets(k).Range("F26").FormulaR1C1 = "='Info Sheet'!R[-24]C[41]"
Sheets(k).Range("F28").FormulaR1C1 = "='Info Sheet'!R[-26]C[42]"
Sheets(k).Range("F31").FormulaR1C1 = "='Info Sheet'!R[-29]C[43]"
Next
However, how can I make it to something like this so that the formular will refer to the cell of next row in sheet "Info Sheet" :
when k=3
Sheets(k).Range("F22").FormulaR1C1 = "='Info Sheet'!R[-19]C[38]"
Sheets(k).Range("F23").FormulaR1C1 = "='Info Sheet'!R[-20]C[39]"
Sheets(k).Range("F25").FormulaR1C1 = "='Info Sheet'!R[-22]C[40]"
Sheets(k).Range("F26").FormulaR1C1 = "='Info Sheet'!R[-23]C[41]"
Sheets(k).Range("F28").FormulaR1C1 = "='Info Sheet'!R[-25]C[42]"
Sheets(k).Range("F31").FormulaR1C1 = "='Info Sheet'!R[-28]C[43]"
Any advice, please
Thanks.