::: Excel - How to suppress blanl lines from an Excel sheet (tab) ?

I

infojacques

Hello,

Has any one a macro to suppress the blank lines of an Excel sheet
(tab)?

Many thanks in advance,

Jacques
 
G

Gord Dibben

Can be done without a macro.

Select a column and F5>Special>Blanks>OK

Format>Row>Hide.

If you want a macro................

Sub HidEmptyRows()
''only if entire row is blank
LastRow = ActiveSheet.UsedRange.Row - 1 + _
ActiveSheet.UsedRange.Rows.Count
Application.ScreenUpdating = False
For r = LastRow To 1 Step -1
If Application.CountA(Rows(r)) = 0 Then
Rows(r).Hidden = True
' Rows(r).Delete
End If
Next r
End Sub


Gord Dibben MS Excel MVP
 
Top