Hi,
Here's an other suggestion:
Results will be output to Sheet2 (must exists before running the code)
Sub Test()
Dim ar, Dic
Dim i As Integer, j As Integer, n As Integer
Dim str As String
Set Dic = CreateObject("Scripting.dictionary")
'Store value in aray
ar = Cells(1).CurrentRegion.Value
n = 2
For i = 2 To UBound(ar, 1)
str = ar(i, 3) & ar(i, 7)
If Not Dic.exists(str) Then
Dic.Add str, n
For j = 1 To UBound(ar, 2)
ar(n, j) = ar(i, j)
Next j
n = n + 1
Else
For j = 1 To UBound(ar, 2)
Select Case j
Case 5, 6:
ar(Dic(str), j) = ar(Dic(str), j) + ar(i, j)
Case Else:
ar(Dic(str), j) = ar(i, j)
End Select
Next j
End If
Next i
'Output results to sheet2 (must exists)
With Sheets(2)
.Cells(1).CurrentRegion.Clear
.Cells(1, 1).Resize(n - 1, UBound(ar, 2)) = ar
End With
End Sub
Bookmarks