View Single Post
 
Old 12-25-2014, 06:10 AM
gmayor's Avatar
gmayor gmayor is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

It needs a minor adjustment to account for that :
Code:
Sub DeleteEmptyRows()
'Graham Mayor
Dim rng As Range
Dim i As Long
Dim LastRow As Long
    With ActiveSheet
        LastRow = .Cells(.Rows.Count, "G").End(xlUp).Row - 4        'G is the column with the last row of data
        Set rng = .Range("A1:D" & LastRow)        'Set the range to the area to be processed
        For i = LastRow To 10 Step -1        'Process from the bottom
            If WorksheetFunction.CountA(rng.Rows(i)) = 0 Then rng.Rows(i).EntireRow.Delete
        Next i
    End With
End Sub
Thanks for the heads up about the link. There was an unwanted space in the link. Now it should be fixed.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote