View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Deleting rows, multiple column criteria

Why not just repeat for column N, pick up the stragglers.

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Lift Off" wrote in
message ...

I've been using this code to delete rows based upon data in one column.
How do I modify the code to include a second column? i.e. delete the
row if "either" column "M" _or_ "N" is empty. I've tried changing the
Range to ("M:M", "N:N") and it doesn't work.

On Error Resume Next
Intersect(Rows("2:" & Rows.Count),
Range("M:M").SpecialCells(xlBlanks, _
xlTextValues)).EntireRow.Delete
Intersect(Rows("2:" & Rows.Count),
Range("M:M").SpecialCells(xlConstants, _
xlTextValues)).EntireRow.Delete
Intersect(Rows("2:" & Rows.Count),
Range("M:M").SpecialCells(xlFormulas, _
xlTextValues + xlErrors + xlLogical)).EntireRow.Delete
On Error GoTo 0

Thanks for the help.


--
Lift Off
------------------------------------------------------------------------
Lift Off's Profile:

http://www.excelforum.com/member.php...fo&userid=8249
View this thread: http://www.excelforum.com/showthread...hreadid=506868