View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Two column deletion

Rick Rothstein has brought this to us :
.Columns(1).SpecialCells(xlConstants, xlErrors).EntireRow.Delete
.Columns(2).SpecialCells(xlConstants, xlErrors).EntireRow.Delete


The above two lines of code from your posted code can be converted into a
single line...

.Range("A:B").SpecialCells(xlConstants, xlErrors).EntireRow.Delete

Rick Rothstein (MVP - Excel)


True IF there's only 1 error per row. Otherwise, nothing gets deleted!
I suppose we can assume there's only 1 criteria value per row but that
doesn't cover it if a user screws up OR values get put in both columns.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc