Option Explicit
Sub Soledad()
Dim i&, j&, Lr, t&, R&, k&, Lr1&, R1&
Dim Arr(), Arr1(), Res(), KQ()
Dim Dic As Object, Key, Temp
With Sheets("theogioi")
Lr = .Cells(Rows.Count, 7).End(xlUp).Row
Arr = .Range("G4:I" & Lr).Value
End With
R = UBound(Arr)
Set Dic = CreateObject("Scripting.Dictionary")
ReDim Res(1 To R, 1 To 2)
For i = 1 To R
Key = Arr(i, 1) & "#" & Arr(i, 2)
If Not Dic.Exists(Key) Then
t = t + 1: Dic.Add (Key), t
Res(t, 1) = Arr(i, 2): Res(t, 2) = Arr(i, 3)
End If
Next i
With Sheets("Hethong")
Lr1 = .Cells(Rows.Count, 8).End(xlUp).Row
Arr1 = .Range("H4:I" & Lr).Value
R1 = UBound(Arr)
ReDim KQ(1 To R1, 1 To 2)
For i = 1 To R1
Temp = Arr1(i, 1) & "#" & Arr1(i, 2)
If Dic.Exists(Temp) Then
k = Dic.Item(Temp)
KQ(i, 1) = Res(k, 1)
KQ(i, 2) = Res(k, 2)
End If
Next i
.Range("L4").Resize(i - 1, 2) = KQ
End With
Set Dic = Nothing
MsgBox "Done"
End Sub