Here's the code written by JieJenn yesterday. He/She wrote a code that's doing something similar to what youre asking for, except the 2 sheets are in the same workbook.
I've altered the code a bit to work on two workbooks. There are many open questions remaining about your inquiry(are both files open, will the names always be the same, which range is supposed to be copied etc.). The code works - you can change it complete your needs. If you don't know how, I can give it a try, but please attach an example of what needs to be done where first :0
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim LR As Long, i As Long
Dim wsP As Worksheet
1 Application.ScreenUpdating = False
Set wsP = Workbooks("Book1.xlsm").Worksheets(1)
If Target.Column = 1 Then
With wsP
LR = .Cells(Rows.Count, 1).End(xlUp).Row
If LR < 1 Then
Application.ScreenUpdating = True
Exit Sub
End If
Workbooks("test.xlsx").Sheets(1).Range("A2:M50").ClearContents
For i = 2 To LR
If .Cells(i, 1) > 0 Then
With Workbooks("test.xlsx").Sheets(1)
.Cells(.Cells(Rows.Count, 1).End(xlUp).Row + 1, 1) = wsP.Cells(i, 1)
.Cells(.Cells(Rows.Count, 2).End(xlUp).Row + 1, 2) = wsP.Cells(i, 2)
.Cells(.Cells(Rows.Count, 3).End(xlUp).Row + 1, 3) = wsP.Cells(i, 3)
.Cells(.Cells(Rows.Count, 4).End(xlUp).Row + 1, 4) = wsP.Cells(i, 4)
.Cells(.Cells(Rows.Count, 5).End(xlUp).Row + 1, 5) = wsP.Cells(i, 5)
.Cells(.Cells(Rows.Count, 6).End(xlUp).Row + 1, 6) = wsP.Cells(i, 6)
.Cells(.Cells(Rows.Count, 7).End(xlUp).Row + 1, 7) = wsP.Cells(i, 7)
.Cells(.Cells(Rows.Count, 8).End(xlUp).Row + 1, 8) = wsP.Cells(i, 8)
.Cells(.Cells(Rows.Count, 9).End(xlUp).Row + 1, 9) = wsP.Cells(i, 9)
.Cells(.Cells(Rows.Count, 10).End(xlUp).Row + 1, 10) = wsP.Cells(i, 10)
End With
End If
Next i
End With
End If
Application.ScreenUpdating = True
End Sub
Bookmarks