Sub GoYa()
On Error Resume Next
Application.ScreenUpdating = False
Dim lLastrow1 As Long
Dim lLastrow2 As Long
Dim Dictionary As Object, arr(), key As String, j As Long, i As Long
Dim MyArr()
Dim li As Long
Sheets(2).Cells.ClearContents
MyArr = Array("Данные", "google", "yandex", "Данные", "google", "yandex")
Sheets(2).[a1:f1] = MyArr
Sheets(1).Range("A2:A" & Sheets(1).Cells(Rows.Count, 1).End(xlUp).Row).Copy
Sheets(2).[a2].PasteSpecial xlPasteValues
Sheets(1).Range("E2:E" & Sheets(1).Cells(Rows.Count, 1).End(xlUp).Row).Copy
Sheets(2).Range("A" & Sheets(2).Cells(Rows.Count, 1).End(xlUp).Row + 1).PasteSpecial xlPasteValues
Application.CutCopyMode = False
Sheets(2).Range("A1:A" & Sheets(1).Cells(Rows.Count, 1).End(xlUp).Row).RemoveDuplicates Columns:=1, Header:=xlNo
For li = Sheets(2).Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1
If Sheets(2).Range("A" & li).Value = "" Then: Sheets(2).Range("A" & li).Delete (3)
Next
Sheets(2).Range("A2:A" & Sheets(2).Cells(Rows.Count, 1).End(xlUp).Row).Copy Sheets(2).[d2]
lLastrow1 = Sheets(1).Cells(Rows.Count, 1).End(xlUp).Row
lLastrow2 = Sheets(2).Cells(Rows.Count, 1).End(xlUp).Row
Set Dictionary = CreateObject("Scripting.Dictionary")
arr = Sheets(1).Range("A1:C" & lLastrow1).Value
For i = 1 To UBound(arr, 1)
key = arr(i, 1) & arr(i, 2)
If Not Dictionary.Exists(key) Then Dictionary.Add key, arr(i, 3)
Next
With Sheets(2).Range("A1:C" & lLastrow2)
arr = .Value
For j = 2 To UBound(arr, 1)
For i = 2 To UBound(arr, 2)
key = arr(j, 1) & arr(1, i)
arr(j, i) = Dictionary.Item(key)
Next
Next
.Value = arr
End With
Set Dictionary = CreateObject("Scripting.Dictionary")
arr = Sheets(1).Range("E1:G" & lLastrow1).Value
For i = 1 To UBound(arr, 1)
key = arr(i, 1) & arr(i, 2)
If Not Dictionary.Exists(key) Then Dictionary.Add key, arr(i, 3)
Next
With Sheets(2).Range("D1:F" & lLastrow2)
arr = .Value
For j = 2 To UBound(arr, 1)
For i = 2 To UBound(arr, 2)
key = arr(j, 1) & arr(1, i)
arr(j, i) = Dictionary.Item(key)
Next
Next
.Value = arr
End With
Sheets(2).Select
[a1].Select
Application.ScreenUpdating = True
End Sub
Киса, я хочу Вас спросить, как художник — художника: Вы рисовать умеете?