P
Peter Chatterton
I have a work sheet with 65,536 rows
only the first 12,000 of which have data,
but I can't figure out how to delete the empty but active rows.
I could do a reverse Find from the end and then delete the trailing Range,
but hoped there might be an easier way.
I thought the following, from Chapter 5 of Excel 2002 VBA Programmer's
Reference,
(www.wrox.com/WileyCDA/WroxTitle/productCd-0764543717,descCd-download_code.html)
might work (going by the title), but it doesn't.
Sub DeleteEmptyRows()
Dim rngRow As Range
For Each rngRow In ActiveSheet.UsedRange.Rows
If WorksheetFunction.CountA(rngRow) = 0 Then
rngRow.EntireRow.Delete
End If
Next rngRow
End Sub
Hope you can help,
Peter
only the first 12,000 of which have data,
but I can't figure out how to delete the empty but active rows.
I could do a reverse Find from the end and then delete the trailing Range,
but hoped there might be an easier way.
I thought the following, from Chapter 5 of Excel 2002 VBA Programmer's
Reference,
(www.wrox.com/WileyCDA/WroxTitle/productCd-0764543717,descCd-download_code.html)
might work (going by the title), but it doesn't.
Sub DeleteEmptyRows()
Dim rngRow As Range
For Each rngRow In ActiveSheet.UsedRange.Rows
If WorksheetFunction.CountA(rngRow) = 0 Then
rngRow.EntireRow.Delete
End If
Next rngRow
End Sub
Hope you can help,
Peter