title: Delete Row based on Search Key VBA
body: <p>I am trying to delete <strong>every</strong> row in which the value "X" is found in column B using VBA. However, I'm having three problems:</p>
  
  <ol>
  <li>I can't get my VBA code to move down from the active cell to the next cell (B3) using cells.find method (see code below)</li>
  <li>My code does not delete the entire row where the value "X" is found in column B</li>
  <li>The amount of Data in Column B can vary: it can end at B10 today, or B100 tomorrow (see screen shot below)</li>
  </ol>
  
  <p>Any assistance will be greatly appreciated.</p>
  
  <pre><code>Sub RemoveRows()   
      Dim strLookFor As String
      Dim strRow As String
  
      Worksheets("Sheet1").Range("B2").Activate
  
      strLookFor = "X"
      strRow = Range("B2").Address
  
      Do Until ActiveCell.Value = ""        
          MsgBox (ActiveCell.Value)        
          If ActiveCell.Value = strLookFor Then
              Rows.Delete (strRow)
          End If            
          strRow = Cells.Find(what:=strLookFor).Address
      Loop
  
      MsgBox ("Deleted all rows with value " &amp; strLookFor)    
  End Sub
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/6XOIY.png" alt="enter image description here"></p>