ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   copy a formula down up to blank cells from other sheet (https://www.excelbanter.com/excel-programming/406653-copy-formula-down-up-blank-cells-other-sheet.html)

Eva

copy a formula down up to blank cells from other sheet
 
I have two sheets:Master with all data and sheet2 with some columns that are
the same as master. I set a formula simply links some data in Sheet2.
I need to copy this formula in sheet2 down up to last row in master sheet.
I started working on the macro, but I am stuck. Can you help?
Sub Macro7()

Sheets("Master").Select

Dim LastRow As Long

LastRow = Cells(Rows.Count, 1).End(xlUp).Row

'MsgBox OstatniWiersz


Sheets("Sheet2").Select
Range("a2:s2").Select
Selection.Copy
....?

Bernie Deitrick

copy a formula down up to blank cells from other sheet
 
Eva,

Replace

Range("a2:s2").Select
Selection.Copy
....?

With

Range("a2:s2").Copy Range("a2:s" & LastRow)

HTH,
Bernie
MS Excel MVP


"Eva" wrote in message
...
I have two sheets:Master with all data and sheet2 with some columns that are
the same as master. I set a formula simply links some data in Sheet2.
I need to copy this formula in sheet2 down up to last row in master sheet.
I started working on the macro, but I am stuck. Can you help?
Sub Macro7()

Sheets("Master").Select

Dim LastRow As Long

LastRow = Cells(Rows.Count, 1).End(xlUp).Row

'MsgBox OstatniWiersz


Sheets("Sheet2").Select
Range("a2:s2").Select
Selection.Copy
...?





All times are GMT +1. The time now is 08:37 AM.

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