I am trying to set up a macro to format a report that I download. Most of the formatting is simply deleting rows that contain certain words or blank rows. When I run the macro, it deletes the rows with "amount" in them, but doesnt delete the rows that are blank. But if I run the macro again, it deletes most of the empty rows. Ultimately, I have to run the macro 3 times in order to get everything formatted properly.
How can I get this thing to work properly?
Heres the code:
For i = 1 To Range("A65536").End(xlUp).Row
If (Cells(i, 2) = ("Amount")) _
Then
Rows(i).EntireRow.Delete
End If
Next i
For i = 1 To Range("A65536").End(xlUp).Row
If (Cells(i, 2) = ("")) _
Then
Rows(i).EntireRow.Delete
End If
Next i
How can I get this thing to work properly?
Heres the code:
For i = 1 To Range("A65536").End(xlUp).Row
If (Cells(i, 2) = ("Amount")) _
Then
Rows(i).EntireRow.Delete
End If
Next i
For i = 1 To Range("A65536").End(xlUp).Row
If (Cells(i, 2) = ("")) _
Then
Rows(i).EntireRow.Delete
End If
Next i