I have written code per my specification in post #1 , but it only deleted the row sin yellow i.e. where there is only a single positive and one single negative value that matches , but not where there are multiple debit values that sum up to multiple credits values i.e if one has for g three values that total 525.25 and multiple credit values that totals -525.25 then these rows must be deleted
It would be appreciated if someone could amend my code per my specification in post #1
Sub Del_Rows_MatchingValues()
Dim fnd As Range, lr As Long
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Set fnd = Rows("1:1").Find("Balance", LookIn:=xlValues)
lr = Cells(Rows.Count, fnd.Column).End(xlUp).Row
With Range("D2:D" & lr): .Formula = "=COUNTIF(C$2:$C$" & lr & ",B2)<>COUNTIF($C$2:C$" & lr & ",-C2)": .Value = .Value: End With
With Sheet1
With .Cells(1).CurrentRegion
.AutoFilter 4, "FALSE"
.Offset(1, 0).SpecialCells(12).EntireRow.Delete
End With
.AutoFilterMode = False
.Columns("D:D").Clear
End With
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub
Bookmarks