Thread: [Solved] Remove rows less than 10
View Single Post
 
Old 07-18-2014, 10:19 AM
jolivanes jolivanes is offline Windows XP Office 2007
Advanced Beginner
 
Join Date: Sep 2011
Posts: 93
jolivanes will become famous soon enough
Default

Not tested. Run this after all the other code has finished doing it's thing.
Maybe to test it, run it as a separate macro.

Code:
Sub jolivanes()
    Dim lr As Long, lc As Long, sh As Worksheet
    Application.ScreenUpdating = False
    For Each sh In ActiveWorkbook.Sheets
        If sh.Name<>"Extended Default" And sh.Name<>"Failed Default" Then    '<----- Check spelling and capitalizing of sheet names.
        With sh
            lr = .Cells(.Rows.Count, 4).End(xlUp).Row
            lc = .Cells(1, .Columns.Count).End(xlToLeft).Column
            .Range(.Cells(1, 1), .Cells(lr, lc)).AutoFilter 4, "<11"
            .Range(.Cells(2, 1), .Cells(lr, lc)).SpecialCells(12).EntireRow.Delete
        End With
        sh.AutoFilterMode = False
        End If
    Next sh
    Application.ScreenUpdating = True
End Sub
Reply With Quote