ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Code to copy the last row formulas and paste it in the bottom row (https://www.excelbanter.com/excel-programming/431024-code-copy-last-row-formulas-paste-bottom-row.html)

Chetu[_2_]

Code to copy the last row formulas and paste it in the bottom row
 
Hi

I have a set of data from column A to DO, This data are based on
formulas linked to another worksheet. Once the main sheet gets new
data the Sheet having formulas must copy the formulas from the last
row and paste the same in new row, so that the corresponding new data
gets updated in formula sheet.

For example

A B C
1 =([worksheet1]A1) =([worksheet1]B1) =([worksheet1]C1)
2 =([worksheet1]A2) =([worksheet1]B2) =([worksheet1]C2)

When i update the Raw file with ROW 3 details, The formula sheet
should copy the formulas from Row 2 and paste it in row 3 so that new
changes takes place.

Can you please give me the VB code for the same.

Patrick Molloy

Code to copy the last row formulas and paste it in the bottom row
 
to copy the last row to the next empty row

Option Explicit
Sub copylast()
With Rows(Range("A1").End(xlDown).Row)
.Copy
Range("A1").End(xlDown).Offset(1).PasteSpecial xlPasteFormulas
Application.CutCopyMode = False
End With
End Sub




"Chetu" wrote in message
...
Hi

I have a set of data from column A to DO, This data are based on
formulas linked to another worksheet. Once the main sheet gets new
data the Sheet having formulas must copy the formulas from the last
row and paste the same in new row, so that the corresponding new data
gets updated in formula sheet.

For example

A B C
1 =([worksheet1]A1) =([worksheet1]B1) =([worksheet1]C1)
2 =([worksheet1]A2) =([worksheet1]B2) =([worksheet1]C2)

When i update the Raw file with ROW 3 details, The formula sheet
should copy the formulas from Row 2 and paste it in row 3 so that new
changes takes place.

Can you please give me the VB code for the same.



Chetan[_3_]

Code to copy the last row formulas and paste it in the bottom row
 
Hi Molloy,

Thank you very much for the code, it works fine but i have a question.
If the main sheet has 10 updates and if i run the code in formula
sheet, it updates only one record, How can i extend this ocde so that
the formula is applied to the equal nunber of rows updated in main
sheet.

Thanks in advance.
Chetan.J

Chetan[_3_]

Code to copy the last row formulas and paste it in the bottom row
 
On Jul 15, 9:50*am, Chetan wrote:
Hi Molloy,

Thank you very much for the code, it works fine but i have a question.
If the main sheet has 10 updates and if i run the code in formula
sheet, it updates only one record, How can i extend this ocde so that
the formula is applied to the equal nunber of rows updated in main
sheet.

Thanks in advance.
Chetan.J


ANY ANSWERS PLEASE!!!!!!!!!!!!!!!!!


All times are GMT +1. The time now is 10:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com