Sub f()
Dim a() As Variant, s As String
a = Sheet1.UsedRange
With Sheet2
For i = 1 To UBound(a)
For j = 1 To Sheet2.[a65536].End(xlUp).Row
If a(i, 1) = .Cells(j, 1) Then
.Cells(j, 1).EntireRow.Copy Sheet1.Cells(i, 1)
End If
Next
Next
End With
End Sub