Q: Excel VBA - Code Issue - Goal to Delete or Clear Entire Rows for which Specific Cell doesn't Certain Text I am trying to write a macro that will go through my spreadsheet and clear or delete each row for which a specific cell in that row doesn't contain certain text.  Here is my code. 
Sub BIWeekly_VP_Removal()

Dim BI_Erow As Long
Dim VPName As String
Dim i As Integer


'Find and store last row
BI_Erow = Cells(Rows.Count, 1).End(xlUp).Row

'Store VP to not delete
VPName = InputBox("VP to Keep")

'Loop through and clear all rows not containing target VP
For i = 2 To BI_Erow

    If Cells(i, 13).Value <> "VPName" Then

        ActiveSheet.Rows(i).EntireRow.Clear

    End If

Next i

'set new last row of range
BI_Erow = Cells(Rows.Count, 1).End(xlUp).Row

'Select new range and sort
Rows("2:" & BI_Erow).Select

End Sub

Currently, when run this code clears every line of this range, even when the identified cell contains the name that has been input.  I am guessing I am doing something obviously wrong but I am stuck.
I am new to coding and am trying to teach myself.  I know I am doing something wrong and any constructive feedback the community may have would be greatly appreciated!
Thank You

A: Below is some code I have used in the past to do what you have described above.  Hope this helps.
Sub Delete_Row_If_Not_IT()
'Macro deletes entire row if "IT" is not found in column "E"

    Dim RowToTest As Long
    Application.ScreenUpdating = False      'turn off screen updating. Code runs faster without screen flicker
    Application.Calculation = xlManual      'turn auto calc to manual

    'Column Count 5 = "E"
    For RowToTest = Cells(Rows.Count, 5).End(xlUp).Row To 2 Step -1

    'Saves listed "IT" entities and deletes the rest.
    'Column Count 5 = "E"
    With Cells(RowToTest, 5)
        If .Value <> "IT" Then               'maybe use wildcard char "*" before and after search word.
        Rows(RowToTest).EntireRow.Delete
        End IF 
    End With

    Next RowToTest

    Application.Calculation = xlAutomatic    'turns auto calc back on
    Application.ScreenUpdating = True        'turn on screen updating

    End Sub

You can probably utilize an InputBox to replace the anti-search variable.
