Macro to delete rows if they do not contain specific text

  • Hello,

    I am currently working on a macro that will scan columns "E" and "I" and if they do not contain "Inserted" or "ClassID" the row should be deleted. I've tried multiple different variations but can't seem to get it right.. below is what I have so far:

    Sub EvaluateD()
    Dim i, LastRow
    Dim UserIDModLog

    UserIDModLog = ActiveSheet.Name

    LastRow = UserIDModLog(Rows.Count).End(xlUp).Row
    For i = LastRow To 1 Step -1
    If UserIDModLog.Value <> "Inserted" Or "ClassID" Then
    End If
    Next i
    End Sub

    Help :(

  • .
    This is one method :

  • Post by aladanh ().

    This post was deleted by rory: Spam ().