Sub test()
Dim ws, a, i&, s$, w, dic As Object
Set dic = CreateObject("Scripting.Dictionary")
For Each ws In Worksheets
If ws.Name <> "MASTER" Then
a = ws.Cells(1).CurrentRegion.Value
For i = 2 To UBound(a, 1)
If a(i, 2) = "CCV" Then
s = Join(Array(a(i, 1), a(i, 3)), Chr(2))
If Not dic.exists(s) Then
ReDim w(1 To 4)
w(1) = a(i, 1): w(2) = a(i, 2): w(3) = a(i, 3)
Else
w = dic(a(i, 2))
End If
w(4) = w(4) + a(i, 4): dic(s) = w
End If
Next
End If
Next
With Sheets("MASTER").Cells(1).CurrentRegion
.Offset(1).ClearContents
If dic.Count Then .Rows(2).Resize(dic.Count).Value = Application.Index(dic.Items, 0, 0)
End With
End Sub