regn,
What's happen to your previous thread.
https://www.excelforum.com/excel-pro...ntire-set.html
vba
Sub test()
Dim a, e, i As Long, dic As Object
Set dic = CreateObject("Scripting.Dictionary")
With Sheets("sheet1").Cells(1).CurrentRegion
a = .Value
For i = 2 To UBound(a, 1)
a(i, 2) = CStr(a(i, 2))
dic(a(i, 2)) = dic(a(i, 2)) + a(i, 3)
Next
For Each e In dic
If dic(e) <> 0 Then dic.Remove e
Next
If dic.Count Then
.AutoFilter 2, dic.keys, 7
.Offset(1).EntireRow.Delete
End If
.Parent.AutoFilterMode = False
End With
End Sub
Bookmarks