ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Finding Empty Rows (https://www.excelbanter.com/excel-programming/271811-re-finding-empty-rows.html)

Tom Ogilvy

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





All times are GMT +1. The time now is 11:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com