czwartek, 22 października 2015

Excel vba: Best macro to remove empty rows from listobject tables.

Best reliable, highly recommended: 'http://www.excelforum.com/excel-programming-vba-macros/847446-auto-resize-shrink-table-on-an-active-sheet.html

Sub ert()
Dim lo As ListObject
'Application.ScreenUpdating = False
On Error Resume Next    'if SpecialCells(4) not exists
For Each lo In ActiveSheet.ListObjects
    With lo
        .ListColumns(1).Range.SpecialCells(4).Resize(, .ListColumns.Count).Delete shift:=xlUp
    End With
Next lo
'Application.ScreenUpdating = True
End Sub

Brak komentarzy:

Prześlij komentarz