Delete Rows where there are #N/A Values

  • Thread starter Thread starter FIRSTROUNDKO via OfficeKB.com
  • Start date Start date
F

FIRSTROUNDKO via OfficeKB.com

Hi,

I have a collumn

X
#N/A
X
X
#N/A
#N/A
#N/A

The #N/A's where produced through vlookups but I have copy paste special so
they are value only I have tried the sub

LASTROW2 = Cells(Rows.Count, 1).End(xlUp).row
For NB = LASTROW2 To 1 Step -1
Cells(NB, 5).Select
If Cells(NB, 5).Value = "X" Then
Selection.EntireRow.Delete
End If
Next NB

But all rows is deleted

Thanks

In Advance
 
If this is something that you do not need to automate you could just sort
your sheet with the X, N/A column as the key field, this will group all the
#N/A's together where you can delete them enmasse and then sort the sheet
back to the way you had it.
 

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