This is just a first draft. No declaring variables, no sheetnames ...
I think there equally fast.
Sub ba()
t = Timer
sn1 = Range("C2", Range("C" & Rows.Count).End(xlUp)).Resize(, 2)
sn2 = Range("H2").CurrentRegion.Value
For i = 1 To UBound(sn1)
For ii = 2 To UBound(sn2)
If sn1(i, 1) = sn2(ii, 1) Then sn1(i, 2) = sn2(ii, 2): Exit For
Next
Next
Range("c2").Resize(UBound(sn1), 2) = sn1
MsgBox (Timer - t) * 10
End Sub
Sub ba2()
t = Timer
sn1 = Range("C2", Range("C" & Rows.Count).End(xlUp)).Resize(, 2)
sn2 = Range("H2").CurrentRegion.Value
With CreateObject("scripting.dictionary")
For i = 2 To UBound(sn2)
.Item(sn2(i, 1)) = sn2(i, 2)
Next
For i = 1 To UBound(sn1)
If .exists(sn1(i, 1)) Then sn1(i, 2) = .Item(sn1(i, 1))
Next
End With
Range("c2").Resize(UBound(sn1), 2) = sn1
MsgBox (Timer - t) * 10
End Sub
Bookmarks