Copy changed rows into a new sheet and save them

  • Thread starter Thread starter EM
  • Start date Start date
E

EM

Is it possible (of course it is..., but) to make a simple macro (or some
other way) to copy all the changed records to sheet2. I mean the whole
row....
And how does this clever Xl-alien in my computer now that at first time one
row is copied to row1 but next time it is row2 and so on...

And 1 more thing... I have a function in one cell that shoud be the date the
record was created, but it keeps changing...

sorry my english and confused explanations
 
Assume you are working in Sheet1 and you make a change to any cell in
Range("A1:D100"). The following code will copy the entire row where you made
the change and add that row to next blank row of Sheet2 Col A. Keep in mind,
if you make say 4 changes in row 10, this will add 4 rows to Sheet2, ie it
does not delete the previously copied rows.


Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("A1:D100")) Is Nothing Then
Target.EntireRow.Copy _
Destination:=Sheets("Sheet2").Range("A65536").End(xlUp)(2)
End If

End Sub

To install this code: highlight it and copy
Go to sheet1 and RT-click on the TAB
Click View Code
Paste the code in the right panel
 
Well, it works half(?). In my hands, it only copies the data if it's
made in columnA.. How to put it, so that it cheks the whole sheet1?
Sorry my stupidity..., just started with this...
 

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