N
Newby
I have a column range containing values and also some
#DIV/0! errors. I would like to loop through the range and
delete rows containg the #DIV/0!s
I have tried the following code:
Range("P").Cells(1).Select
Do Until Selection = ""
If Selection = "#DIV/0!" Then
Selection.EntireRow.Delete
End If
Selection.Offset(1).Select
Loop
This fails on the 2nd line when a #DIV/0! cell is
encountered. The loop will work successfully if I
insert 'On Error Resume Next' above line 2 but this is
dangerous since it will ignore other errors that I may not
wish to ignore. Please advise on a better way
TIA
Rodders
#DIV/0! errors. I would like to loop through the range and
delete rows containg the #DIV/0!s
I have tried the following code:
Range("P").Cells(1).Select
Do Until Selection = ""
If Selection = "#DIV/0!" Then
Selection.EntireRow.Delete
End If
Selection.Offset(1).Select
Loop
This fails on the 2nd line when a #DIV/0! cell is
encountered. The loop will work successfully if I
insert 'On Error Resume Next' above line 2 but this is
dangerous since it will ignore other errors that I may not
wish to ignore. Please advise on a better way
TIA
Rodders