ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to delete blank rows (https://www.excelbanter.com/excel-programming/312531-macro-delete-blank-rows.html)

jim

Macro to delete blank rows
 
I have text in Column A1:A2000 that has lots of blank rows
that I need deleted. I would like to compact all the data
so I don't have to scroll down so far.

Thanks
Jim


Tom Ogilvy

Macro to delete blank rows
 
sub DeleteRealBlanks()
On Error Resume Next
Range("A1:A2000").SpecialCells(xlBlanks).EntireRow .delete
On Error goto 0
End Sub

--
Regards,
Tom Ogilvy

"Jim" wrote in message
...
I have text in Column A1:A2000 that has lots of blank rows
that I need deleted. I would like to compact all the data
so I don't have to scroll down so far.

Thanks
Jim




Jorge Rodrigues

Macro to delete blank rows
 
See Ron de Bruin's answer at:
http://groups.google.com/groups?q=de...n&lr=&ie=UT F
-8&c2coff=1&selm=OYezTxiUDHA.2040%40TK2MSFTNGP11.ph x.gbl&rnum=3
Jorge
"Jim" escreveu na mensagem
...
I have text in Column A1:A2000 that has lots of blank rows
that I need deleted. I would like to compact all the data
so I don't have to scroll down so far.

Thanks
Jim




Ron de Bruin

Macro to delete blank rows
 
Hi Jim

On Error Resume Next 'In case there are no blank rows
Range("A1:A2000").SpecialCells(xlCellTypeBlanks).E ntireRow.Delete
On Error GoTo 0

If you do this for a whole column be carfull with the SpecialCells limit
http://support.microsoft.com/default...b;en-us;832293

David have a example om his site to avoid problems
http://www.mvps.org/dmcritchie/excel/delempty.htm

The sub is named del_COLA_empty()


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Jim" wrote in message ...
I have text in Column A1:A2000 that has lots of blank rows
that I need deleted. I would like to compact all the data
so I don't have to scroll down so far.

Thanks
Jim




Frank Kabel

Macro to delete blank rows
 
Hi
see:
http://www.xldynamic.com/source/xld.Deleting.html

--
Regards
Frank Kabel
Frankfurt, Germany

"Jim" schrieb im Newsbeitrag
...
I have text in Column A1:A2000 that has lots of blank rows
that I need deleted. I would like to compact all the data
so I don't have to scroll down so far.

Thanks
Jim




All times are GMT +1. The time now is 01:38 AM.

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