JimS
07-31-2009, 01:09 PM
I'm trying to delete the entire row if a formula in column A has a #REF! error. The range starts at A5 and could be up to 200 rows.
This seems like an easy one but I have been able to make it work.
Thanks...
Jim
Sub DelRefErrors()
Dim ColNum As Integer
Sheets("Metrics").Select
'Find Last Row with Data in Column A
For ColNum = 1 To 1
NxtLastRow = Cells(Rows.Count, ColNum).End(xlUp).Row
If NxtLastRow > LastRow Then LastRow = NxtLastRow
Next
'Check Column A for Formula Errors
For DelRow = LastRow To 1 Step -1
If (Cells(DelRow, 1) IsError Then <<< Doesn't like this line >>>>
End If
Next
End Sub
This seems like an easy one but I have been able to make it work.
Thanks...
Jim
Sub DelRefErrors()
Dim ColNum As Integer
Sheets("Metrics").Select
'Find Last Row with Data in Column A
For ColNum = 1 To 1
NxtLastRow = Cells(Rows.Count, ColNum).End(xlUp).Row
If NxtLastRow > LastRow Then LastRow = NxtLastRow
Next
'Check Column A for Formula Errors
For DelRow = LastRow To 1 Step -1
If (Cells(DelRow, 1) IsError Then <<< Doesn't like this line >>>>
End If
Next
End Sub