Try this.
![]()
Sub DeleteRows() Dim rng As Range ' ' Delete Macro ' ' With ActiveSheet .Unprotect "BEC" .Range("$AJ$2:$AL$1000000").Autofilter Field:=1, Criteria1:="0" Set rng = .Range(.Range("AJ3"), .Range("AJ3").End(xlDown)) On Error Resume Next rng.SpecialCells(xlCellTypeVisible).EntireRow.Delete On Error Goto 0 .Range("$AJ$2:$AL$1000000").Autofilter Field:=1 .Range("B4:B8").Select .Protect "BEC" End With End Sub
Bookmarks