ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Deleting rows based upon the value in column D (https://www.excelbanter.com/excel-programming/314596-deleting-rows-based-upon-value-column-d.html)

Sean

Deleting rows based upon the value in column D
 
Hi, I would like to delete all rows in my spreadheet that have a non-numeric
or null value in column D.

The length of my spreadsheet will vary in length and there is no column
headings in the spreadsheet, just pure data from row A onwards.

Thanks in advance.
Sean


Tom Ogilvy

Deleting rows based upon the value in column D
 
On Error Resume Next
columns(4).SpecialCells(xlConstants,xlTextValues). EntireRow.Delete
columns(4).SpecialCells(xlBlanks).EntireRow.Delete
On Error goto 0

If the values are produced by formulas you can use xlFormulas,xlTextValues

if you have error values
xlFormulas,xlErrors

or Logical

xlFormulas,xlLogical

See help on special cells for other options.

--
Regards,
Tom Ogilvy


"Sean" wrote in message
...
Hi, I would like to delete all rows in my spreadheet that have a

non-numeric
or null value in column D.

The length of my spreadsheet will vary in length and there is no column
headings in the spreadsheet, just pure data from row A onwards.

Thanks in advance.
Sean




ackurv[_3_]

Deleting rows based upon the value in column D
 

very nice, I was able to consolidate the following three lines
recorded, into one.

Columns("B:B").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.EntireRow.Delete

Thanks, To

--
ackur
-----------------------------------------------------------------------
ackurv's Profile: http://www.excelforum.com/member.php...fo&userid=1552
View this thread: http://www.excelforum.com/showthread.php?threadid=27204



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

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