egoburnswell
New Member
- Joined
- Sep 2, 2015
- Messages
- 5
Hi, so I have large workbooks that contain many sheets each with many rows of data.
lots of these rows are either entirely #N/As or entirely zero, and I would like to remove these. I have some code that sort of does it:
However it's very slow and it seems to hang. The "good" bit of the data is mostly numeric, but not entirely, and contains isolated DIV/0 which messes up attempts to sum across rows instead of checking each element.
I tried using Selection.Autofilter with various options, but couldn't get this to work correctly.
Any help would be appreciated. Thanks.
lots of these rows are either entirely #N/As or entirely zero, and I would like to remove these. I have some code that sort of does it:
Code:
Dim ws As Worksheet
Application.ScreenUpdating = False
Application.Calculation = xlcalculateMaual
For Each ws In ActiveWorkbook.WorkSheets
ws.Activate
Debug.Print ws.Name
B = Range("b3").End(xlDown).Row
For i = B To 3 Step -1
If IsError(Range("a" & i).Value) Then
Range("a" & i).EntireRow.Delete
Else
For j = 1 To 16
If Cells(i, j).Value = 0 Then
If j = 16 Then Range("a" & i).EntireRow.Delete
Else
Exit For
End If
Next j
End If
Next i
Next ws
Application.ScreenUpdating = True
Application.Calculation = xlcalculateAutomatic
However it's very slow and it seems to hang. The "good" bit of the data is mostly numeric, but not entirely, and contains isolated DIV/0 which messes up attempts to sum across rows instead of checking each element.
I tried using Selection.Autofilter with various options, but couldn't get this to work correctly.
Any help would be appreciated. Thanks.