COPY FORMULA TO THE LAST CELL

K

K

I got formulas in cells "G5" , "H5" , "I5" , "J5" and "K5" and I got
data in
coloumn "A" aswell. I want Macro to copy the formulas looking at
coloumn "A" data. Like if I got data or values in coloumn "A" from
cell
"A5" to cell "A100" then Macro should copy formulas from
cells "G5" , "H5" , "I5" , "J5" to cells "G100" , "H100" , "I100" ,
"J100"
In other words Macro should always look data to last cell of coloumn
"A" and copy formulas in coloumns "G" , "H" , "I" , "J" and "K" to
same
last cell where the data ends in coloumn "A". Please If anybody can
help.
 
R

Roger Govier

Hi

Try

Sub ExtendFormulae()
Dim lr As Long

Sheets("Sheet1").Activate
lr = Cells(Rows.Count, "A").End(xlUp).Row
Range("G5:K5").Copy Range("G5").Offset(0, 0).Range("A1:A" & lr - 4)
Application.CutCopyMode = False

End Sub
 
K

K

Hi

Try

Sub ExtendFormulae()
Dim lr As Long

    Sheets("Sheet1").Activate
    lr = Cells(Rows.Count, "A").End(xlUp).Row
    Range("G5:K5").Copy Range("G5").Offset(0, 0).Range("A1:A" & lr - 4)
    Application.CutCopyMode = False

End Sub

--
Regards
Roger Govier






- Show quoted text -

Thanks Roger. your Macro was very helpful
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top