ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   copy data input to archive (https://www.excelbanter.com/excel-programming/407017-copy-data-input-archive.html)

access user

copy data input to archive
 
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

joel

copy data input to archive
 
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
"access user" wrote:

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


joel

copy data input to archive
 
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

"access user" wrote:

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


dan dungan

copy data input to archive
 
Hi James,

Have a look at Ron de Bruin's website:

http://www.rondebruin.nl/tips.htm.

There is a Copy/Paste/Merge examples section.

hth

dan

access user

copy data input to archive
 
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

"Joel" wrote:

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

"access user" wrote:

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


access user

copy data input to archive
 
What is "ArchLastRow" out of interest? How does excel know what it is?

"Joel" wrote:

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

"access user" wrote:

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



All times are GMT +1. The time now is 05:35 AM.

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