Hello,

I have this code (compliments of VBA Noob) which hides all blank rows within a range ("Range1") P16:V650
It works great in a new worksheet with little amount data, however within my heavy worksheet, it takes over a minute to compile.

Sub HideRows()
Dim Rng As Range
Set Rng = Range("Range1")
For i = Rng.Rows.Count To 1 Step -1 
If WorksheetFunction.CountA(Rng.Rows(i)) = 0 Then
Rng.Rows(i).EntireRow.Hidden = True
End If
Next i
End Sub




I'm currently using this secondary code (provided by shg) which hides all blank rows between two columns, (Range1) & (Range2)

Sub JP() 
     Intersect( Range("Range1").SpecialCells(xlCellTypeBlanks).EntireRow, _ 
    Range("Range2").SpecialCells(xlCellTypeBlanks).EntireRow) _ 
    .EntireRow.Hidden = True 
End Sub

Works terrifically in my worksheet, and Is lightning fast.



Is there a way to modify the 1st code for more speed efficiency?
My initial inquiry was to hide blank rows within a Range



thanks for any help.


Jeff