I have written code to delete all rows to clear data containing #N/A (Columns A to F)
It comes up with a run time error 13 Type Mismatch and the following code is highlighted
If IsError(Cells(i, "A") + 1) Then .Rows(i).Delete
It would be appreciated if you could assist
Sub Delete_NA()
Dim i As Long
Dim LastRow As Long
With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
End With
With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = LastRow To 4 Step -1
If IsError(Cells(i, "A") + 1) Then .Rows(i).Delete
Next i
End With
With Application
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
End With
End Sub
It comes up with a run time error 13 Type Mismatch and the following code is highlighted
If IsError(Cells(i, "A") + 1) Then .Rows(i).Delete
It would be appreciated if you could assist
Sub Delete_NA()
Dim i As Long
Dim LastRow As Long
With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
End With
With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = LastRow To 4 Step -1
If IsError(Cells(i, "A") + 1) Then .Rows(i).Delete
Next i
End With
With Application
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
End With
End Sub