1. Avoid reading/writing in worksheets
2. Avoid inserting/deleting rows/columns in Worksheets
3. avoid calculating/working in ranges
4. use arrays instead
5. always provide a sample file
6. do not quote previous posts
Based on PH's example file
Sub M_snb()
sn = Sheet1.Cells(1).CurrentRegion
With CreateObject("scripting.dictionary")
For j = 1 To UBound(sn)
.Item(sn(j, 1)) = .Item(sn(j, 1)) + sn(j, 2)
Next
Sheet2.Cells(1).Resize(.Count, 2) = Application.Transpose(Array(.keys, .items))
End With
End Sub
If you want to write more then 2 columns and want to sum the values in column G (=column 7):
Sub M_snb()
sn = Sheet1.Cells(1).CurrentRegion
With CreateObject("scripting.dictionary")
For j = 1 To UBound(sn)
st = Application.Index(sn, j)
If .exists(sn(j, 1)) Then st(7) = .Item(sn(j, 1))(7) + st(7)
.Item(sn(j, 1)) = st
Next
Sheet2.Cells(10, 1).Resize(.Count, ubound(sn,2)) = Application.Index(.items, 0, 0)
End With
End Sub