I need to remove lines from an Excel file where the value nets to zero with another line. 1,000 lines out of 10,000 may end up being deleted.
I sort the lines by absolute value from largest to smallest (for now done manually, I can add this later), then iterating through the values and deleting the lines that net to zero.
I have written code to execute on 50 lines, however it doesn't work:
Sub delete_row()
Dim activerow As Integer
activerow = 2
Do
If ActiveSheet.Cells(activerow, 13).Select + ActiveCell.Offset(1, 0) = 0 Then
Rows("activerow:activerow + 1").Select
Selection.Delete Shift:=xlUp
Else: activerow = activerow + 1
End If
Loop Until activerow = 50
End Sub
I am new to VBA and programming.