ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Deleteing Blank Rows (https://www.excelbanter.com/excel-programming/274231-re-deleteing-blank-rows.html)

Tim Otero

Deleteing Blank Rows
 
The below is John Walkenbach's code for doing this. I usually make it a
private sub and call it when needed.

Sub DeleteEmptyRows()
LastRow = ActiveSheet.UsedRange.Row - 1 + _
ActiveSheet.UsedRange.Rows.Count
Application.ScreenUpdating = False
For r = LastRow To 1 Step -1
If Application.CountA(Rows(r)) = 0 Then Rows(r).Delete
Next r
End Sub tim"dayton" wrote in message
...
| In my macro I need to delete rows that are blank down to the end of the
| file. The file's will not always be the same. What would the code be for
| this?
|
| T.I.A.
|
|




All times are GMT +1. The time now is 03:06 PM.

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