ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Hpw do I delete multiple empty rows found between filled rows? (https://www.excelbanter.com/excel-worksheet-functions/248474-hpw-do-i-delete-multiple-empty-rows-found-between-filled-rows.html)

Bill

Hpw do I delete multiple empty rows found between filled rows?
 
My data spreadsheet contains multiple empty rows found among thousands of
filled rows. Is there a way to delete the empty rows collectively without
having to do each one separately?
Thank you

Gary''s Student

Hpw do I delete multiple empty rows found between filled rows?
 
Try this small macro:

Sub macro_der()
Dim i As Long, nLastRow As Long
Set r = ActiveSheet.UsedRange
nLastRow = r.Rows.Count + r.Row - 1
Set r = Rows(nLastRow + 1)
For i = 1 To nLastRow
If Application.CountA(Rows(i)) = 0 Then
Set r = Union(r, Rows(i))
End If
Next
r.Delete
End Sub
--
Gary''s Student - gsnu200908


"Bill" wrote:

My data spreadsheet contains multiple empty rows found among thousands of
filled rows. Is there a way to delete the empty rows collectively without
having to do each one separately?
Thank you


Gord Dibben

Hpw do I delete multiple empty rows found between filled rows?
 
Select a column.

F5SpecialBlanksOK

EditDeleteEntire Row


Gord Dibben MS Excel MVP

On Sat, 14 Nov 2009 16:31:01 -0800, Bill
wrote:

My data spreadsheet contains multiple empty rows found among thousands of
filled rows. Is there a way to delete the empty rows collectively without
having to do each one separately?
Thank you




All times are GMT +1. The time now is 03:16 AM.

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