title: Excel VBA - Delete entire row if cell contains string1 or string2 or string3, etc
body: <p>I would like to remove a row if that row contains a specific string, but I need to do this many times for many strings.</p>
  <p>To be more specific, my speadsheet is ~3000 rows and ~30 columns, but this changes every single day. The first column, and the only one I care about, is the name of a node on a network, and if that node starts with or contains a certain word (bananas, Apples, oranges, PINEAPPLES) I need the whole row deleted and everything to shift up</p>
  <p>This is what I have so far with help from @chrisneilsen...</p>
  <p>This does exactly what I need it to, but is there any code in there that I don't need, or could it be cleaned up? I've mashed up answers and suggestions from a few people and I'm wondering if I've created a monster...</p>
  <pre><code>Sub takeOutTheTrash()
  
      Dim rng As Range
      Dim ItemToDelete As Variant
      Dim ItemsToDelete As Variant
      ItemsToDelete = Array(&quot;Apple&quot;, &quot;banana&quot;, &quot;skittles&quot;, &quot;grapes&quot;, &quot;ORANGES&quot;)
  
      Set rng = ActiveSheet.UsedRange
      For Each ItemToDelete In ItemsToDelete
          deleteGarbage rng, ItemToDelete
      Next
      
  End Sub
  
  Sub deleteGarbage(rng As Range, Value As Variant)
  
      Dim pos As Long
      Dim rw As Long
      Dim col As Long
  
      For rw = rng.Rows.Count To 1 Step -1
          For col = 1 To rng.Columns.Count
              If InStr(LCase(rng.Cells(rw, col).Value2), LCase(Value)) &gt; 0 Then
                  rng.Rows(rw).EntireRow.Delete
                  Exit For
              End If
          Next col
      Next rw
      
  End Sub
  </code></pre>