I have created a loop to delete rows if the value in column BD is zero. The loop can take up to a half hour. I have seen recommendations to use autofilters or create variant arrays to expedite the function. Let me know if you can suggest a better solution for my code below.
Const colBD As Long = 56
Dim IRow As Long
Dim LstRow As Long
LstRow = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row
IRow = 3
'loop to delete rows with zero in colBD
Do While IRow <= LstRow
If Cells(IRow, colBD) = 0 Then
Cells(IRow, 1).EntireRow.Delete
LstRow = LstRow - 1 ' one less row
Else
IRow = IRow + 1 ' move to next row
End If
Loop
Range.Delete. It's the delete operation that takes the most time.Application.ScreenUpdating = Falsebefore the loop (and don't forget to turn it back on afterwards)