Sub test1()
Dim a, i As Long, b(), y
Application.ScreenUpdating = False
a = Sheets(2).Range("d1").CurrentRegion.Value
With CreateObject("Scripting.Dictionary")
.CompareMode = 1
For i = 1 To UBound(a, 1)
.Item(a(i, 1)) = Empty
Next
'y = .keys
a = Sheets(1).Range("d1").CurrentRegion.Value
ReDim b(1 To UBound(a, 1), 1 To 1)
For i = 1 To UBound(a, 1)
If .Exists(a(i, 1)) Then
b(i, 1) = "ok"
Else
b(i, 1) = "à traiter"
End If
Next
End With
Sheets(1).Range("g1").Resize(UBound(b, 1)).Value = b
Application.ScreenUpdating = True
End Sub