Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Copy changed rows into a new sheet and save them

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 252
Default Copy changed rows into a new sheet and save them

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

"EM" wrote:

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Copy changed rows into a new sheet and save them





*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Copy changed rows into a new sheet and save them

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



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Copy changed rows into a new sheet and save them


That problem solved:)




"emma makela" kirjoitti
...
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...



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy rows from one Data sheet to another sheet based on cell conte John McKeon Excel Discussion (Misc queries) 2 May 15th 10 06:49 AM
copy rows to other sheet Carpe Diem Excel Worksheet Functions 3 December 17th 07 06:58 PM
Search for rows in one sheet and copy into another sheet based on customer id [email protected] Excel Worksheet Functions 1 October 22nd 07 03:09 AM
Copy rows to master sheet Carolyn[_3_] Excel Programming 3 May 23rd 04 06:08 PM
copy printarea from more than 3 sheet & save in new book. Shital Excel Programming 1 October 4th 03 10:47 AM


All times are GMT +1. The time now is 10:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"