On Jan 23, 12:38 am, cpasearc...@gmail.com wrote:
> I had a friend that used to do this and damn it if I can find that
> file. Anyway, does anyone know how to condense a spreadsheet using a
> macro that can select and hide only the rows that are empty.
Try this code.
Public Sub hideEmpty()
Dim rng As Excel.Range
Dim rngCell As Excel.Range
With ActiveSheet
Set rng = Intersect(.UsedRange, .Range("A:A"))
End With
For Each rngCell In rng
If Application.WorksheetFunction.CountA(rngCell.EntireRow) = 0
Then
rngCell.EntireRow.RowHeight = 0
End If
Next rngCell
End Sub