title: Excel VBA: Delete the entire row based on the condition
body: <p>I have a macro-enabled sheet which has three worksheets. I want to delete the entire row if the value in column F is &quot;T&quot; only from sheet1. Here's the code I tried:</p>
  <pre><code>Sub RemoveRows()
  Dim i As Long
  Set ws = Sheets(&quot;Sheet1&quot;)
  lRow = ws.Range(&quot;F&quot; &amp; Rows.Count).End(xlUp).Row 
  With ws
  For i = 2 To lRow 
  If InStr(.Range(&quot;F&quot; &amp; i), &quot;T&quot;) &gt; 0 Then
  ThisWorkbook.ActiveSheet.Range(&quot;F&quot; &amp; i).EntireRow.Delete
  End If
  Next i
  End With
  Application.ScreenUpdating = True
  End Sub
  </code></pre>
  <p>It deleted the rows, but not completely. Still, I can see the value &quot;T&quot; in column F. Can anyone please point out me with the wrong in the code?</p>