Sub d_rows()Dim i As LongIf (Range("type").Value <> 5) Then For i = ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Row To 1 Step -1 If Cells(i, 1).Interior.ColorIndex = 6 Then Rows(i).Delete Next End IfEnd Sub
Sub d_rows() Dim i As Integer, LastRow As Integer If (Range("type").Value <> 5) Then With Application: .ScreenUpdating = False: .EnableEvents = False LastRow = ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Row For i = LastRow To 1 Step -1 If Cells(i, 1).Interior.ColorIndex = 6 Then Rows(i).Delete Next .ScreenUpdating = True: .EnableEvents = True: End With End IfEnd Sub
Sub УдалениеСтрокОднимМахом()Dim i As Long, LastRow As Long, DelRa As Range LastRow = Cells(Rows.Count, 1).End(xlUp).Row Application.ScreenUpdating = False For i = 1 To LastRow If Cells(i, 1).Interior.ColorIndex = 6 Then If DelRa Is Nothing Then Set DelRa = Cells(i, 1) Else Set DelRa = Union(DelRa, Cells(i, 1)) End If End If Next If Not DelRa Is Nothing Then DelRa.EntireRow.Delete Application.ScreenUpdating = TrueEnd Sub
Sub delFilter() Dim t!, lr& t = Timer Application.ScreenUpdating = False lr = Cells(Rows.Count, 1).End(xlUp).Row ActiveSheet.Range("A1:A" & lr).AutoFilter _ Field:=1, Criteria1:=RGB(255, 255, 0), Operator:=xlFilterCellColor ActiveSheet.AutoFilter.Range.Offset(1).EntireRow.Delete ActiveSheet.AutoFilter.Range.AutoFilter Debug.Print "delFilter - " & Timer - t Application.ScreenUpdating = TrueEnd Sub
Sub DelRowsRS() Dim lr&, n&, i&, ii& Dim sF$, s$, spl Dim k: k = 4 Application.ScreenUpdating = False lr = Cells(Rows.Count, 1).End(xlUp).Row n = ActiveSheet.UsedRange.Row s = "A" For i = lr To n Step -1 If Cells(i, 1).Interior.ColorIndex = 6 Then GoSub sRange Next If Len(s) Then sF = sF & "|" & Left(s, Len(s) - 2) If Len(sF) Then spl = Split(sF, "|") For i = 1 To UBound(spl) Range(spl(i)).EntireRow.Delete k = k + 1 Next End If Application.ScreenUpdating = True Exit SubsRange: s = s & i & ",A" ' =====check len=============== ii = ii + Len(Format(i, 0)) + 2 If ii >= 248 Then sF = sF & "|" & Left(s, Len(s) - 2) s = Left(s, Len(s) - 2) ii = 0 s = "A" End If ' ====================ReturnEnd Sub