I am wanting to speed up a looping code that is removing Rows that contain a #DIV/0! error in cells BU6:BU1783. This code takes an extremely long time to run as it seems to keep updating other sheets on each deleted Row.
I need help to work out code that will calculate the 1st error (or blank) row, then make that the starting Row to delete rows beyond that up to a fixed row without it having to loop.
The data in the data table will always start from Row 6 but the final Row is variable but no greater that Row 1783.
The formula in Column "BU" was a simple filtering formula to return a 1 or 0 for in sheet filtering. I can use other Columns like "B" which would be Blank to also do this.
An example would be data in rows 6 to 100 and I want to delete rows 101 (This is the variable) to 1783 (Constant)
At the moment I am using the following code:
Application.ScreenUpdating = False
Application.Calculation = xlManual
Dim d As Long
For d = 1783 To 2 Step -1
If IsError(Sheets("Raw Data").Range("I" & d)) Then
Rows(d).EntireRow.Delete
End If
Next d
Application.Calculation = xlAutomatic
Application.ScreenUpdating = True
Thanks for your help in advance.