title: vba if cells do not equal values then delete
body: <p>I'm fairly new to VBA and I can't seem to figure this one out through google.</p>
  
  <p>I'm trying to run through a worksheet and use an If statement to delete unnecessary columns, based on their row 1 values. I'm trying to do it like this:</p>
  
  <pre><code>    Sub Macro1
      Dim cell As Range
      For Each cell In Rows("1")
      If cell.Value &lt;&gt;  "order_number", "tax_details", "etc"
      Then .EntireColumn.delete
      End Sub
  </code></pre>
  
  <p>But I can't seem to figure out how to use the "If cell.Value" statement with multiple values, nor how to delete the columns that I don't want. Any help is much appreciated. </p>
  
  <p>Cheers, </p>
  
  <p>Justin</p>
  
  <p>Edit: Thanks for all the responses guys, everything was super helpful. Fixed the problem and I learned a lot.</p>