View Single Post
  #2   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

Colin Hayes formulated on Friday :

Hi

I'm trying to delete all the rows in my worksheet which have any blank cells
in them.

This doesn't work properly :

Columns.Select
Selection.SpecialCells(xlCellTypeBlanks).EntireRow .Delete


Can someone suggest an amendment to this? Also if a popup could be worked in
for the user to confirm delete I'd be grateful.

Thanks.


This is trying to delete all cells in every column that's not
containing content. Try limiting your selection to UsedRange so
columns/rows outside this are left alone. If yo want to delete extra
cols/rows outside the UsedRange it might work better to select rows (or
cols), delete, then select cols (or rows) and delete again.

--
Garry

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