Need a copy macro

  • Thread starter Thread starter PCOR
  • Start date Start date
P

PCOR

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
..
 
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
 
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
 

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

Back
Top