View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default How can I Delete rows were the first cell is blank?

If the cells are actually blank and don't just look blank (contains a space
or a formula that returns a null string as examples that won't work)

Sub DeleteRows()
Dim rng as Range
On Error resume next
set rng = columns(1).specialcells(xlblanks)
On error goto 0
if not rng is nothing then
rng.EntireRow.Delete
End if
End sub

--
Regards,
Tom Ogilvy

"Mascot" wrote:

HI,

I was wondering if there is Macro for this. I have a spreadsheet were
periodically
throughout column a the first cell is blank (the rest of the row
has Data but I don't need it. Does some one have a macro that will search for
these blank cells and delete the row?

Thanks
Mascot