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 |
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 |
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