Sub Macro2()
'//Declare variables//
Dim varDelItem As Variant
Dim lngRowStart As Long, _
lngRowLast As Long, _
lngRowActive As Long
Dim strMyCol As String
Dim rngDelRange As Range
'//Set variables//
varDelItem = "IP-0000063409"
lngRowStart = 2 'Initial data row. Change to suit.
strMyCol = "E" 'Column containing relevant data. Change to suit.
lngRowLast = Cells(Rows.Count, strMyCol).End(xlUp).Row
Application.ScreenUpdating = False
For lngRowActive = lngRowStart To lngRowLast
If Cells(lngRowActive, strMyCol) <> varDelItem Then
'Cater for initial setting of 'rngDelRange' range
If rngDelRange Is Nothing Then
Set rngDelRange = Cells(lngRowActive, strMyCol)
Else
Set rngDelRange = Union(rngDelRange, Cells(lngRowActive, strMyCol))
End If
End If
Next lngRowActive
'If the 'rngDelRange' range has been set (i.e. has something in it), then...
If Not rngDelRange Is Nothing Then
'...delete the rows within it.
rngDelRange.EntireRow.Delete xlShiftUp
'Else...
Else
'...inform the user that no rows are to be deleted as there was no _
matching criteria in the dataset.
MsgBox "No rows were deleted as every Row in Column " & strMyCol & " matched """ & varDelItem & """.", vbExclamation, "Delete Row Editor"
End If
Application.ScreenUpdating = True
End Sub