How to handle Cells Value #N/A

  • Thread starter Thread starter thompsonf
  • Start date Start date
T

thompsonf

Please help! Does anyone know how to handle cells value = "#N/A". I
have encountered an error message with the macro below. But it seems
to be working if I change it as Cells(j, 9) = "N/A"


******************************************
Sub HighlightUseless()

Dim j As Integer

Application.ScreenUpdating = False
j = 2

Do While Cells(j, 1) <> ""
If Cells(j, 9) = "#N/A" Then
Rows(j).Select
Rows(j).Interior.ColorIndex = 6
'Selection.EntireRow.Delete
Else
End If
j = j + 1
Loop
End Sub
*******************************************
 
Sub HighlightUseless()

Dim j As Integer

Application.ScreenUpdating = False
j = 2

Do While Cells(j, 1) <> ""
If Cells(j, 9).Text = "#N/A" Then
Rows(j).Select
Rows(j).Interior.ColorIndex = 6
'Selection.EntireRow.Delete
Else
End If
j = j + 1
Loop
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top