copy data input to archive

  • Thread starter Thread starter access user
  • Start date Start date
A

access user

Hi

I would like to copy data input rows from sheet InputData to another sheet
called Archive. The data is from rows 2 onwards (row 1 is header info). On
the archive sheet the data should get appended to the first blank row. Can
someone help me with a macro for this?

thanks
James
 
With Sheets("Archive")
ArchLastRow = .Range("A" & Rows.Count).End(xlUp).Row
End With
With Sheets("InputData")
InLastRow = .Range("A" & Rows.Count).End(xlUp).Row
.Rows("2:" & InLastRow).Copy _
Destination:=Sheets("Sheet2").Rows(ArchLastRow + 1)
End With
 
I had sheet2 instead of Archive in one place in the code

With Sheets("Archive")
ArchLastRow = .Range("A" & Rows.Count).End(xlUp).Row
End With
With Sheets("InputData")
InLastRow = .Range("A" & Rows.Count).End(xlUp).Row
.Rows("2:" & InLastRow).Copy _
Destination:=Sheets("Archive").Rows(ArchLastRow + 1)
End With
 
Joel

Thanks for that. Additionally, I forgot to mention, I wanted to erase the
data (that's copied to the archive sheet) from the input sheet. So that after
each transfer of data to the archive sheet, the range ont the input sheet
where the data was copied from is cleared. Is that quite easy to do
programmatically?

tia
James
 
What is "ArchLastRow" out of interest? How does excel know what it is?
 

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