title: VBA If Last Two Characters equals "XX" Then Delete Entire Row
body: <p>I am trying to run a macro where it looks at a string and determines whether the last two characters equal "XX", then it is to delete the entire row.</p>
  
  <p>I am getting a object error oh the highlighted below.</p>
  
  <pre><code>Sub Oval2_Click()
  
  
  Last = Cells(Rows.Count, "E").End(xlUp).Row
  
  For i = Last To 1 Step -1
  
  `If (Right(Cells(i, "E"), 2).Value) = "TZ" Then`
  
      Cells(i, "E").EntireRow.Delete
  
  End If
  Next i
  
  End Sub
  </code></pre>
  
  <p>Please help! Thank you.</p>