Sub DeleteRowTool()
Dim rRange As Range
Dim strCriteria As String
Dim lCol As Long
Dim rHeaderCol As Range
Dim xlCalc As XlCalculation
Const strTitle As String = "Row Delete Tool"
On Error Resume Next
Step1:
Set rRange = Application.InputBox(Prompt:="Select range including header range" _
, Title:=strTitle & " Step 1 of 3", Default:=ActiveCell.CurrentRegion.Address, Type:=8)
If rRange Is Nothing Then Exit Sub
Application.GoTo rRange.Rows(1), True
Step2:
lCol = Application.InputBox(Prompt:="Please enter relative column number of evaluation column" _
, Title:=strTitle & " Step 2 of 3", Default:=1, Type:=1)
If lCol = 0 Then Exit Sub
Step3:
strCriteria = InputBox(Prompt:="Please enter a single criteria." & _
vbNewLine & "Eg >5 OR <10 OR Cat* OR *Cat OR *Cat*" _
, Title:=strTitle & " Step 3 of 3")
If strCriteria = vbNullString Then Exit Sub
With Application
xlCalc = .Calculation
.Calculation = xlCalculationManual
.EnableEvents = False
.ScreenUpdating = False
End With
ActiveSheet.AutoFilterMode = False
With rRange
.AutoFilter Field:=lCol, Criteria1:=strCriteria
.Offset(1, 0).SpecialCells(xlCellTypeVisible).EntireRow.Delete
End With
ActiveSheet.AutoFilterMode = False
With Application
.Calculation = xlCalc
.EnableEvents = True
.ScreenUpdating = True
End With
On Error GoTo 0
End Sub