title: Looping through columns to find and delete rows
body: <p>I am trying to create a automated way to do some clean up on a document. I am opening a txt file into excel and just dumping everything into column A. I wrote a script that will do the format the information into columns. I then need to search the doc for a string of text at which point I delete that row plus 10 rows down. I've managed to accomplish this but when it gets to the point where there is no more rows with the specified text I get a Run Time 91 error. </p>
  
  <p>Just a little background, I am very new to using VBAs. So this may be a very basic fix. </p>
  
  <p>I was also thinking maybe I can run a macros that looks for this string of text and deletes the rows first, that way it's only searching in column A rather than multiple columns. </p>
  
  <p>Below is the code I am using. Pretty much found it online and just changed it to fit my needs</p>
  
  <p>Hopefully someone can tell me what I am doing wrong or suggest another way to get this job done.</p>
  
  <p>Thank you</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>Sub FindAndDelete()
  
  Dim found As Range
  
  Do Until found = False
          
      Set found = ActiveSheet.Columns("A:R").Find(what:="Based on Positions as of Month-End, No Pa", LookIn:=xlValues, lookat:=xlWhole)
      
          found.EntireRow.Select
          
          found.EntireRow.Delete
          
          ActiveCell.Offset(0, 0).EntireRow.Delete
          ActiveCell.Offset(0, 0).EntireRow.Delete
          ActiveCell.Offset(0, 0).EntireRow.Delete
          ActiveCell.Offset(0, 0).EntireRow.Delete
          ActiveCell.Offset(0, 0).EntireRow.Delete
          ActiveCell.Offset(0, 0).EntireRow.Delete
          ActiveCell.Offset(0, 0).EntireRow.Delete
          ActiveCell.Offset(0, 0).EntireRow.Delete
          ActiveCell.Offset(0, 0).EntireRow.Delete
          ActiveCell.Offset(0, 0).EntireRow.Delete
       
  Loop
  
  End Sub</code></pre>
  </div>
  </div>
  </p>