this code worked fine yesterday, but not today.
When I run the code step by step, the deleted rows comes back with end With. Why?
When I run the code step by step, the deleted rows comes back with end With. Why?
Code:
Sub DeleteRowsBasedOnCriteria()
With ActiveSheet
If .AutoFilterMode = False Then .Cells(1, 1).AutoFilter
.Range("A1").AutoFilter Field:=1, Criteria1:="Delete"
.Range("A1").CurrentRegion.Offset(1,0).SpecialCells(xlCellTypeVisible).EntireRow.Delete
.AutoFilterMode = False
End With
Comment