ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Delete Rows where there are #N/A Values (https://www.excelbanter.com/excel-worksheet-functions/103006-delete-rows-where-there-n-values.html)

FIRSTROUNDKO via OfficeKB.com

Delete Rows where there are #N/A Values
 
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

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200608/1


tim m

Delete Rows where there are #N/A Values
 
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.

"FIRSTROUNDKO via OfficeKB.com" wrote:

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

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200608/1



Ron de Bruin

Delete Rows where there are #N/A Values
 
Hi FIRSTROUNDKO

Try a example on this page
http://www.rondebruin.nl/delete.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl



"FIRSTROUNDKO via OfficeKB.com" <u15639@uwe wrote in message news:6437e9e5a6c6c@uwe...
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

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200608/1




FIRSTROUNDKO via OfficeKB.com

Delete Rows where there are #N/A Values
 
Thanks Again

Darren

Ron de Bruin wrote:
Hi FIRSTROUNDKO

Try a example on this page
http://www.rondebruin.nl/delete.htm

Hi,

[quoted text clipped - 24 lines]

In Advance


--
Message posted via http://www.officekb.com



All times are GMT +1. The time now is 10:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com