Option Explicit Sub abc() Dim i, a, d, t a = Range("g2:h" & [g2].End(xlDown).Row).Value Set d = CreateObject("scripting.dictionary") For i = 1 To UBound(a) t = Trim(a(i, 1)) If d.exists(t) Then MsgBox t: Exit Sub Else d(t) = a(i, 2) Next a = Range("a2:a" & [a2].End(xlDown).Row).Value For i = 1 To UBound(a) t = Trim(a(i, 1)) If d.exists(t) Then a(i, 1) = d(t) Else a(i, 1) = Empty Next [d2].Resize(UBound(a)) = a End Sub