Finding Empty Rows
On Error Resume Next
range("A2:A25001").SpecialCells(xlBlanks).EntireRo w.Delete
On Error goto 0
Regards,
Tom Ogilvy
"Kevin G" wrote in message
...
I have a spreadsheet with approx. 25,000 rows in it. Some
of those rows are completely blank. I wrote a FOR/NEXT
loop to find and delete those rows, but it's not working
exactly how I want. Here's what I wrote:
range("a2:a25001").select
dim acell as range
for each acell in selection
if acell = "" then
acell.entirerow.delete
end if
next acell
After running this it seems that it finds a few of the
empty rows, deletes them, and then stops looking.
Am I doing something wrong?? Any help would be appreciated.
Thanks,
Kevin
|