Hi!
I have a sheet with data.
I want to remove the entire row if range B137 to b23368 is "0"
I have the following code (se below)
The code works fine, but if I have two 0's in a row, it will skip the 2nd one for some reason. (I guess thats becuase it moves the row one line up after deleting it)
I tried to just run the macro several times, wich also works, but its time consuming and really annoying.
I need to point out that all data above B137 can not be modified by this macro.
Any solutions here?
Best Reggards:
Wigarth
I have a sheet with data.
I want to remove the entire row if range B137 to b23368 is "0"
I have the following code (se below)
The code works fine, but if I have two 0's in a row, it will skip the 2nd one for some reason. (I guess thats becuase it moves the row one line up after deleting it)
I tried to just run the macro several times, wich also works, but its time consuming and really annoying.
I need to point out that all data above B137 can not be modified by this macro.
Any solutions here?
Best Reggards:
Wigarth
Code:
For Each cell In Range("b137:b233")
If Not IsEmpty(cell) Then
If cell.Value = 0 Then
cell.EntireRow.Delete
End If
End If
Next