Try this code:
Public Sub Pass1()
Dim Ary As Variant
Dim i As Long
Dim Dest As Range
Dim las As Long
With Sheets("New")
Ary = .Range("A2", .Range("A" & Rows.Count).End(xlUp)).Value2
Set Dest = Range("D2")
las = .Cells(Rows.Count, "D").End(xlUp).Row
Range("D2:D" & las).Value = ""
.Activate
End With
With CreateObject("scripting.dictionary")
.comparemode = 1
For i = 1 To UBound(Ary)
.Item(Ary(i, 1)) = Empty
Next i
With Sheets("old")
Ary = .Range("A1", .Range("A" & Rows.Count).End(xlUp)).Value2
End With
For i = 2 To UBound(Ary)
If .Exists(Ary(i, 1)) Then .Remove Ary(i, 1)
Next i
Ary = .keys
End With
Sheets("old").Activate
Set Dest = Dest.Resize(UBound(Ary) + 1, 1)
Dest.Value = Application.Transpose(Ary)
'MsgBox Join(Ary)
Call pass2
End Sub
Public Sub pass2()
Dim Ary As Variant
Dim i, la As Long
Dim Dest As Range
With Sheets("old")
Ary = .Range("a2", .Range("a" & Rows.Count).End(xlUp)).Value2
Set Dest = Range("D2")
End With
With CreateObject("scripting.dictionary")
.comparemode = 1
For i = 1 To UBound(Ary)
.Item(Ary(i, 1)) = Empty
Next i
With Sheets("old")
.Activate
la = .Cells(Rows.Count, "D").End(xlUp).Row
Range("D2:D" & la).Value = ""
End With
With Sheets("new")
Ary = .Range("A2", .Range("A" & Rows.Count).End(xlUp)).Value2
End With
For i = 1 To UBound(Ary)
If .Exists(Ary(i, 1)) Then .Remove Ary(i, 1)
Next i
Ary = .keys
End With
Set Dest = Dest.Resize(UBound(Ary) + 1, 1)
Dest.Value = Application.Transpose(Ary)
MsgBox Join(Ary)
End Sub
Bookmarks