Sub test()
a = [a10000].End(3).Row
b = [b10000].End(3).Row
c = [c10000].End(3).Row - 1
For i = 1 To a
For j = 1 To b
If Cells(i, 1) = Cells(j, 2) Then
c = c + 1
Cells(c, 3) = Cells(i, 1)
End If
Next j
Next i
d = [c10000].End(3).Row
For k = 1 To d
For l = a To 2 Step -1
If Cells(k, 3) = Cells(l, 1) Then
Cells(l, 1).Delete Shift:=xlShiftUp
End If
Next l
Next k
For k = 1 To d
For l = b To 2 Step -1
If Cells(k, 3) = Cells(l, 2) Then
Cells(l, 2).Delete Shift:=xlShiftUp
End If
Next l
Next k
End Sub