I have written code to delete rows containing zeroes in Col B from sheet 6 onwards from row 2 onwards
When running the macro, it goes into a loop and after a few minutes, I need to shut it down
It would be appreciated if someone could kindly assist me
When running the macro, it goes into a loop and after a few minutes, I need to shut it down
It would be appreciated if someone could kindly assist me
Code:
Sub Delete_Rows_With_Zeroes()
Dim lr As Long, I As Long, R As Long
Application.ScreenUpdating = False
For I = 6 To Worksheets.Count
lr = Sheets(I).Cells(Rows.Count, "B").End(xlUp).Row
For R = lr To 2 Step -1
If Sheets(I).Range("B" & R).Value = 0 Then
Sheets(I).Rows(R).Delete
End If
Next R
Next I
Application.ScreenUpdating = True
End Sub
Last edited: