View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bob Bob is offline
external usenet poster
 
Posts: 972
Default Removing blank rows

Thomas,
Very slick! I gave your macro a try and was amazed at how fast it works.
In fact, it even caught cells with 2 blank spaces. Thank you! I sincerely
appreciate all your help.
Regards, Bob

"Thomas Ramel" wrote:

Grüezi Bob

Bob schrieb am 20.06.2006

I have a 1-column spreadsheet that contains data in column H (with a heading
in cell H1). Some rows in column H contain no data or a single space.
Starting with cell H2, I needed a macro that would examine each cell in
column H and automatically delete a row where no data or only 1 space exists.

I would greatly appreciate any help.


Try the following code:

With Range("H:H")
.Replace " ", "", xlWhole
.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End With



Mit freundlichen Grüssen
Thomas Ramel

--
- MVP für Microsoft-Excel -
[Win XP Pro SP-2 / xl2000 SP-3]
Microsoft Excel - Die ExpertenTipps:
(http://tinyurl.com/9ov3l und http://tinyurl.com/cmned)