Hi Marc
Thanks for getting back to me and fully understand your predicament
I am attaching another workbook with references, which I hope you will be able to assist
1) Where there is a value in Col C with say a positive value eg 2150 and there is a single value that is negative -2150 then the rows containing these values are to be deleted (I have highlighted all the items in yellow where the positive value and negative values equal to zero). I have also put numbers next to each of the yellow items that match off
2) Where there are several debit balances (have highlighted in different colours) with the same reference then these must be matched to credit balances and vice versa (have indicated the matching with numbers in Col I so you can see how these match off)
3) There may be values where the sum of the debits and credits balance to zero, but they can have mixed references
With regard to point # 1 above, I have written code which matches the Debit & credit values for a single item, but point # 2 & 3 is above is too complicated for me to write the code
Sub delete_same_amount()
Dim lRow&, iRow&, c As Range
lRow = Cells(Rows.Count, 5).End(xlUp).Row
For iRow = lRow To 2 Step -1
If Cells(iRow, 5) > 0 Then
With Columns(5)
Set c = .Find(Cells(iRow, 5).Value * -1, LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
Rows(iRow).Delete shift:=xlUp
c.EntireRow.Delete shift:=xlUp
End If
End With
End If
Next iRow
End Sub
Bookmarks