Sathish KV
Active Member
Hi All,
Thought to share a useful tip!
Always wondered how to create a macro to copy paste formulas to last active cell which may differ on a regular basis
Well the best way of achieving this is to define the last active cell
e.g. If the column A has datas upto certain rows which may change often and you need a macro to create, copy and paste a formula in column B and adjust to the last active cell of column A, then defining the last active cell in column A may come in handy as mentioned below
Thought to share a useful tip!
Always wondered how to create a macro to copy paste formulas to last active cell which may differ on a regular basis
Well the best way of achieving this is to define the last active cell
e.g. If the column A has datas upto certain rows which may change often and you need a macro to create, copy and paste a formula in column B and adjust to the last active cell of column A, then defining the last active cell in column A may come in handy as mentioned below
Code:
Sub Macro1()
lr = Range("A1048576").End(xlUp).Row
Range("B2:B" & lr).FormulaR1C1 = "=RC[-1]+1"
End Sub
Last edited: