Consulting

Results 1 to 4 of 4

Thread: automatic removal of empty rows

  1. #1

    automatic removal of empty rows

    Hello,tell, please, it is possible to create such macro для removal empty rows?
    Attached Files Attached Files
    Last edited by Lichress; 04-08-2017 at 02:47 AM.

  2. #2
    VBAX Expert Logit's Avatar
    Joined
    Sep 2016
    Posts
    613
    Location
    .
    .
    Paste into a Routine Module, activate from command button on sheet :

    Sub DeleteBlankRows1()
    
    
    'Deletes the entire row within the selection if the ENTIRE row contains no data.
    'http://www.ozgrid.com/VBA/VBACode.htm
    
    
    
    
    'We use Long in case they have over 32,767 rows selected.
    
    
    Dim i As Long
    
    
        'We turn off calculation and screenupdating to speed up the macro.
    
    
        With Application
    
    
            .Calculation = xlCalculationManual
    
    
            .ScreenUpdating = False
    
    
        'We work backwards because we are deleting rows.
    
    
        For i = Selection.Rows.Count To 1 Step -1
    
    
            If WorksheetFunction.CountA(Selection.Rows(i)) = 0 Then
    
    
                Selection.Rows(i).EntireRow.Delete
    
    
            End If
    
    
        Next i
    
    
            .Calculation = xlCalculationAutomatic
    
    
            .ScreenUpdating = True
    
    
        End With
    
    
    End Sub
    Attached Files Attached Files

  3. #3
    thanks

  4. #4
    VBAX Expert Logit's Avatar
    Joined
    Sep 2016
    Posts
    613
    Location
    You are welcome !

    Cheers.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •