Sub DeleteRows3()
Dim lLastRow As Long 'Last row
Dim rng As range
Dim rngDelete As range
'Freeze screen
Application.ScreenUpdating = False
'Insert dummy row for dummy field name
Rows(1).Insert
'Insert dummy field name
range("C1").value = "Temp"
With ActiveSheet
.UsedRange
lLastRow = .cells.SpecialCells(xlCellTypeLastCell).row
Set rng = range("C1", cells(lLastRow, "C"))
rng.AutoFilter Field:=1, Criteria1:="Mangoes"
Set rngDelete = rng.SpecialCells(xlCellTypeVisible)
rng.AutoFilter
rngDelete.EntireRow.delete
.UsedRange
End With
End Sub
|