Hi dmreno
Welcome to the Forum!
Try this code. The code assumes you have a header row in Row 1 of each worksheet. Let me know of issues
Option Explicit
Sub test()
Dim lr1 As Long
Dim lr2 As Long
Dim lr3 As Long
Dim nr1 As Long
Dim nr3 As Long
Dim ws1 As Worksheet
Dim ws2 As Worksheet
Dim ws3 As Worksheet
Dim rng1 As Range
Dim rng2 As Range
Dim cel1 As Range
Dim cel2 As Range
Dim FindString As String
Set ws1 = ActiveWorkbook.Sheets("Sheet1")
Set ws2 = ActiveWorkbook.Sheets("Sheet2")
Set ws3 = ActiveWorkbook.Sheets("Sheet3")
lr1 = ws1.Range("A" & Rows.Count).End(xlUp).Row
lr2 = ws2.Range("A" & Rows.Count).End(xlUp).Row
nr1 = lr1 + 1
Set rng2 = ws2.Range("A2:A" & lr2)
For Each cel2 In rng2
FindString = cel2.Value
If Trim(FindString) <> "" Then
With ws1.Range("A2:A" & lr1)
Set rng1 = .Find(What:=FindString, _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If rng1 Is Nothing Then
cel2.EntireRow.Copy
ws1.Range("A" & nr1).PasteSpecial
nr1 = nr1 + 1
Application.CutCopyMode = False
End If
End With
End If
Next cel2
lr1 = ws1.Range("A" & Rows.Count).End(xlUp).Row
lr3 = ws3.Range("A" & Rows.Count).End(xlUp).Row
nr3 = lr3 + 1
Set rng1 = ws1.Range("A2:A" & lr1)
For Each cel1 In rng1
FindString = cel1.Value
If Trim(FindString) <> "" Then
With ws2.Range("A2:A" & lr2)
Set rng2 = .Find(What:=FindString, _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If rng2 Is Nothing Then
cel1.EntireRow.Copy
ws3.Range("A" & nr3).PasteSpecial
nr3 = nr3 + 1
cel1.EntireRow.ClearContents
Application.CutCopyMode = False
End If
End With
End If
Next cel1
With ws1
lr1 = .Range("A" & Rows.Count).End(xlUp).Row
.Range("A1:A" & lr1).AutoFilter Field:=1, Criteria1:="="
.UsedRange.Offset(1, 0).SpecialCells(xlCellTypeVisible).EntireRow.Delete
.AutoFilterMode = False
End With
End Sub
Bookmarks