View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Deleting rows which contain blank cells

Since we're deleting rows, we need to start at the bottom and work
up...

For i = ActiveSheet.UsedRange.Rows.Count To 2 Step -1
If WorksheetFunction.CountA(Rows(i)) < lCols Then Rows(i).Delete
Next 'i

...otherwise the shift after delete will skip a row if going downward!

--
Garry

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