ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need a copy macro (https://www.excelbanter.com/excel-programming/338784-need-copy-macro.html)

PCOR

Need a copy macro
 
Once a week I have to copy the current data from one sheet to an other.
The data is located in COL A to I,inclusive
but the bottom row varies from week to week.
Please tell me how to write a macro to accom-lish this
Thanks
..



Rowan[_4_]

Need a copy macro
 
To copy from Sheet1 to Sheet2:

Sub copyit()
Dim eRow As Long
With Sheets("Sheet1")
eRow = .Cells(Rows.Count, 1).End(xlUp).Row
.Range(.Cells(1, 1), .Cells(eRow, 9)).Copy _
Sheets("Sheet2").Range("A1")
End With
End Sub

Hope this helps
Rowan

"PCOR" wrote:

Once a week I have to copy the current data from one sheet to an other.
The data is located in COL A to I,inclusive
but the bottom row varies from week to week.
Please tell me how to write a macro to accom-lish this
Thanks
..




Steve[_63_]

Need a copy macro
 
Sub copyData()

lastrow = Cells(Rows.Count, "A").End(xlUp).Row
Sheets(1).Range(Cells(1, 1), Cells(lastrow, 9)).Copy_
Sheets(2).Cells(1, 1)

End Sub

hth
steve

On Tue, 30 Aug 2005 23:15:07 -0400, "PCOR"
wrote:

Once a week I have to copy the current data from one sheet to an other.
The data is located in COL A to I,inclusive
but the bottom row varies from week to week.
Please tell me how to write a macro to accom-lish this
Thanks
.





All times are GMT +1. The time now is 04:58 PM.

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