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

  • Thread starter Thread starter infojacques
  • Start date Start date
I

infojacques

Hello,

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

Many thanks in advance,

Jacques
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top