title: Excel 2007 VBA If Then Statement Using Multiple Criteria
body: <p>I have a multiple IF criteria statement, of which if any are true should return the value specified.  When I compile the code below it returns: </p>
  
  <pre><code>cust_num    company name
  
  XX278   
  XX004       Barco   
  XX004   
  XX278   
  XX004   
  XX004   
  XX278   
  XX278   
  </code></pre>
  
  <p>My intention is to have the cust_num "XX278" return "Barco" under company name as well since it matches condition2, but for some reason it's skipping that and doesn't appear to be looping through all of the rows as I intended (e.g. all XX004, XX278 cust_num should have company names).   Why does my code not loop through each row?  Any help would be greatly appreciated.  Thanks!</p>
  
  <pre><code>Dim v As Integer
  Dim y As Integer
  
  y = 0
  condition1 = (ActiveSheet.Rows(1).Find("cust_num", LookAt:=xlPart).Offset(1 + y, 0) = "XX004")
  condition2 = (ActiveSheet.Rows(1).Find("cust_num", LookAt:=xlPart).Offset(1 + y, 0) = "XX278")
  condition3 = (ActiveSheet.Rows(1).Find("cust_num", LookAt:=xlPart).Offset(1 + y, 0) = "XX318")
  
  v = ActiveSheet.Rows(1).Find("customer_name", LookAt:=xlPart).End(xlDown).Count
  
  For y = 0 To v
  If condition1 Or condition2 Or condition3 Then ActiveSheet.Rows(1).Find _
      ("company name",LookAt:=xlPart).Offset(1 + v, 0) = "Barco"
  Next
  </code></pre>