See if this is faster
Sub test()
Dim a, i As Long, ii As Long, w(1 To 7), myCols
myCols = [{1, 2, 3, 5, 7, 10, 12}]
With Sheets("expected result").Cells(1).CurrentRegion
a = .Value
With CreateObject("Scripting.Dictionary")
.CompareMode = 1
For i = 2 To UBound(a, 1)
.Item(a(i, 1)) = w
Next
a = Sheets("raw data").Cells(1).CurrentRegion.Value
For i = 2 To UBound(a, 1)
If .exists(a(i, 1)) Then
For ii = 1 To UBound(myCols)
w(ii) = a(i, myCols(ii))
Next
.Item(a(i, 1)) = w
End If
Next
a = .items
End With
.Offset(1).Resize(.Rows.Count - 1).Value = Application.Index(a, 0, 0)
End With
End Sub
Bookmarks