this updates sheet2 from sheet1 and if it not in sheet1 and no sheet 2 it adds it to sheet2 for
Option Explicit
Sub ptest()
Dim ws1 As Worksheet, ws2 As Worksheet
Dim lastRow As Long, i As Long, found As Range
Application.ScreenUpdating = False
With ThisWorkbook
Set ws1 = .Sheets("Sheet1")
Set ws2 = .Sheets("Sheet2")
End With
lastRow = ws1.Cells(Rows.Count, "a").End(xlUp).Row
For i = 1 To ws1.Cells(Rows.Count, "a").End(xlUp).Row
Set found = ws2.Range("a:a").Find(ws1.Cells(i, "a"), LookIn:=xlValues, LookAt:=xlWhole)
If Not found Is Nothing Then
ws1.Cells(i, "A").Resize(, 9).Copy Destination:=ws2.Cells(found.Row, "a")
Else
ws1.Cells(i, "A").Resize(, 9).Copy Destination:=ws2.Cells(ws2.Rows.Count, "a").End(xlUp).Offset(1, 0)
End If
Next i
Set ws2 = Nothing: Set ws1 = Nothing
Set found = Nothing
Application.ScreenUpdating = True
End Sub
Bookmarks