Sub ThV()
Dim arrIn, arrDK, arrOut As Variant
Dim i, j, numS As Long
Dim KeyS As String
Dim Dic As Object
Set Dic = CreateObject("Scripting.Dictionary")
'//INPUT
arrIn = Range("C4:G" & Range("C1000000").End(xlUp).Row).Value
arrDK = Range("M4:R" & Range("M1000000").End(xlUp).Row).Value
numS = 4
'//PROCESS
ReDim arrOut(1 To UBound(arrDK, 1), 1 To UBound(arrDK, 2) - numS + 1)
For i = LBound(arrIn, 1) To UBound(arrIn, 1)
KeyS = arrIn(i, 1) & arrIn(i, 4)
If Not Dic.Exists(KeyS) Then
Dic.Add KeyS, arrIn(i, 5)
Else
Dic.Item(KeyS) = Dic.Item(KeyS) + arrIn(i, 5)
End If
Next i
For i = LBound(arrDK, 1) To UBound(arrDK, 1)
For j = numS To UBound(arrDK, 2)
KeyS = arrDK(i, 1) & arrDK(i, j)
If Dic.Exists(KeyS) Then
arrOut(i, j - numS + 1) = Dic.Item(KeyS)
End If
Next j
Next i
'//OUTPUT
Range("T4:V" & Range("M1000000").End(xlUp).Row).Value = arrOut
End Sub