I have a spreadsheet with a ton of data exported from another database.
Column H is either blank or has a dollar amount (could be positive or negative). If column H is blank, I want to delete that entire row.
I've done some research and came up with the below but it doesn't seem to be performing the way I am needing it to.
It is deleting empty rows but it is sporadic I want to delete them all in one click.
Need some help in getting this to work and trying to understand why this code is only deleting a portion of the data each time I execute the macro.
Column H is either blank or has a dollar amount (could be positive or negative). If column H is blank, I want to delete that entire row.
I've done some research and came up with the below but it doesn't seem to be performing the way I am needing it to.
It is deleting empty rows but it is sporadic I want to delete them all in one click.
Need some help in getting this to work and trying to understand why this code is only deleting a portion of the data each time I execute the macro.
VBA Code:
Sub DeleteBlankVariances()
Dim rng As Range
lr = Cells(Rows.Count, 1).End(xlUp).Row
Set rng = Range("H2:H" & lr)
For Each c In rng
If c = "" Then c.EntireRow.Delete
Next
End Sub