View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default selecting all blanks in multiple columns, then deleting those rows

selection.EntireRow.Delete

--
Regards,
Tom Ogilvy


"DSSdiva" wrote in message
...
I have done this in just one column: selecting all the blanks and then

using
Selection.EntireRow.Delete. Works fine.

I am now working with a dataset that is formatted just terribly, full of
headers and subtotals, and the best way to clean it up would be to

highlight
the entire range (OK), select all the blanks (OK), and delete the rows

(not
OK).

I get no error message, but Excel just skips that line of code and leaves
all the blanks highlighted as nice as you please. Just neglects to delete
them.

Is this because they are scattered in all different columns? When I stop

the
macro and go to Excel itself, Edit/delete/row wipes out all the proper

rows.
Just can't get it done programmatically, and I don't know why.