View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Delete Empty Rows

lastrow = cells(rows.count,1).End(xlup).row
for i = lastrow to 1 step -1
if Application.CountA(rows(i)) = 0 then
rows(i).Delete
end if
Next

--
Regards,
Tom Ogilvy

"christian" wrote in message
...

Trying to write a macro that will read each row and if there is no data
- delete it. Thought I could use the EntireRow.delete but not having
any luck with it. (Excel 2002)

Now if only I could get the users to stop entering the blank rows...

Any help is appreciated.
-christian


--
christian
------------------------------------------------------------------------
christian's Profile:

http://www.excelforum.com/member.php...o&userid=14361
View this thread: http://www.excelforum.com/showthread...hreadid=261759