copy formulae down one row

liquid

New Member
Joined
Sep 8, 2004
Messages
48
I have a data set in columns R to AJ which currently runs to row 170.

The last row (170 at the moment), is formula driven, and looks into another sheet.

Each day I want to copy the final row of data; paste the formulae into the next row down (so for today it would be copying Range R170: AJ170 and pasting into Range R171:AJ171). Then I want to go back into row 170 and paste over the cells with the values.

The result will be that as my data set grows, only the last row will be formula driven, with all the hostoric data being just values.

Anybody know a simple macro that will achieve this for me??

Thanks in advance.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
liquid.

i think this should do the trick:

Code:
Sub CopyLastRow()

    Dim rngCopy As Range, rngLastRow As Range

'   Create copy range from last row in column R & used columns R:AJ
    Set rngLastRow = Range("R" & Rows.Count).End(xlUp).EntireRow
    Set rngCopy = Intersect(Range("R:AJ"), rngLastRow)
    
'   Copy and paste last row, convert old last row to values
    With rngCopy
        .Copy
        .Offset(1, 0).PasteSpecial xlPasteAll
        .PasteSpecial xlPasteValues
    End With
    
'   Empty object variables
    Set rngCopy = Nothing
    Set rngLastRow = Nothing
    
End Sub

cheers. ben.
 
Upvote 0
you're a star.

Thanks a mill, was wracking my little brain on that and was very close, but just couldn't get it to work

cheers
 
Upvote 0

Forum statistics

Threads
1,224,352
Messages
6,178,064
Members
452,822
Latest member
MtC

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top