![]() |
|
#5
|
||||
|
||||
|
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
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Delete All empty Rows - Print - Undo all Rows deleted
|
Bathroth | Word VBA | 1 | 10-01-2014 01:40 PM |
Grouping table rows to prevent individual rows from breaking across pages
|
dennist77 | Word | 1 | 10-29-2013 11:39 PM |
Delete Blank Rows (Cyrillic Text in Spreadsheet )
|
dozd | Excel | 1 | 02-22-2013 03:24 AM |
Count rows and add blank rows accordingly
|
Hoochtheseal | Word VBA | 1 | 01-29-2013 09:23 PM |
How to remove blank rows from a specified range?
|
Learner7 | Excel | 1 | 04-19-2011 02:45 AM |