Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
copy rows from one Data sheet to another sheet based on cell conte | Excel Discussion (Misc queries) | |||
copy rows to other sheet | Excel Worksheet Functions | |||
Search for rows in one sheet and copy into another sheet based on customer id | Excel Worksheet Functions | |||
Copy rows to master sheet | Excel Programming | |||
copy printarea from more than 3 sheet & save in new book. | Excel Programming |