I have a recon I look at each month that has around 6,000 lines work of data. There are offsetting entries a negative and a po?itive. I have excel 2010 I would like a macro to delete all these entries. I found the below code but I cannot get it to work. I don't do much with macro's so am I doing something wrong when I am recording it.
Private Sub doit_click()
For x = 2 To Cells(Rows.Count, "B").End(xlUp).Row
'Get the string to compare
tacct = Cells(x, 2)
tamt = Cells(x, 5)
For x2 = x + 1 To Cells(Rows.Count, "A").End(xlUp).Row
If Cells(x2, 2) = tacct And tamt + Cells(x2, 5) = 0 Then
Rows(x2).Delete
Rows(x).Delete
x = x - 1
Exit For
End If
Next 'x2
Next 'x
End Sub
Bookmarks