Try:
Sub bar()
Dim x As Range
With Sheet1
For Each x In .Range("A2:A" & .Cells(Rows.Count, 1).End(xlUp).Row)
If Not .Range("B2:B" & .Cells(Rows.Count, 2).End(xlUp).Row).Find(x.Value) Is Nothing Then
.AutoFilterMode = False
.Range("B1:D" & .Cells(Rows.Count, 1).End(xlUp).Row).AutoFilter field:=1, Criteria1:=x.Value
With .AutoFilter.Range
.Offset(1, 0).Resize(.Rows.Count - 1, 3).Copy
End With
.AutoFilterMode = False
.Cells(Rows.Count, 5).End(xlUp).Offset(1, 0).PasteSpecial (xlPasteValues)
Application.CutCopyMode = False
End If
Next x
End With
Bookmarks