Deleting rows

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to delete blank (no data) rows in a range of rows. I have over 10,000 rows and would like to delete the unnecessary rows. Any suggestions?
 
Can you go by a particular column (like column A) or do you have to check
each entire row for data?
 
Hi Pokey,

Assuming the data in your sheet starts in Row 1 you can use the follwing
macro to delete your blank rows. It will insert a new sheet and filter the
data less the blank rows.

Sub DelRwsNewSht()
Dim lastrow As Long

Application.ScreenUpdating = False
Rows("1:2").Insert Shift:=xlDown
Range("H2").Formula = "=COUNTA(4:4)<>0"
lastrow = Cells.SpecialCells(xlLastCell).Row
Sheets.Add after:=ActiveSheet
ActiveSheet.Previous.Rows("3:" & lastrow).AdvancedFilter _
Action:=xlFilterCopy, CriteriaRange:=ActiveSheet.Previous _
.Range("H1:H2"), CopyToRange:=Range("A1"), Unique:=False
ActiveSheet.Previous.Rows("1:2").EntireRow.Delete
End Sub

CHORDially,
Art Farrell

Pokey said:
I would like to delete blank (no data) rows in a range of rows. I have
over 10,000 rows and would like to delete the unnecessary rows. Any
suggestions?
 
Back
Top