title: If Else with multiple conditions
body: <p>I'm trying to implement three conditions and four outcomes:</p>
  
  <p><a href="https://i.stack.imgur.com/063BY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/063BY.png" alt="enter image description here"></a></p>
  
  <p>The values in Col I are driven by a data validation list in the master worksheet.</p>
  
  <p>I tried the following:</p>
  
  <pre><code>If DataImport.Cells(i, "E").Value &lt;&gt; 0 And DataImport.Cells(i, "F").Value &lt;&gt; 0 And DataImport.Cells(i, "I").Value = "Hide" Then
      ThisWorkbook.Worksheets(ws(index)).Visible = False
  ElseIf DataImport.Cells(i, "E").Value = 0 And DataImport.Cells(i, "F").Value = 0 And DataImport.Cells(i, "I").Value = "Hide" Then
      ThisWorkbook.Worksheets(ws(index)).Visible = False
  ElseIf DataImport.Cells(i, "E").Value &lt;&gt; 0 And DataImport.Cells(i, "F").Value &lt;&gt; 0 And DataImport.Cells(i, "I").Value = "Unhide" Then
      ThisWorkbook.Worksheets(ws(index)).Visible = True
  ElseIf DataImport.Cells(i, "E").Value = 0 And DataImport.Cells(i, "F").Value = 0 And DataImport.Cells(i, "I").Value = "Unhide" Then
      ThisWorkbook.Worksheets(ws(index)).Visible = False
  </code></pre>
  
  <p>The procedure is ignoring my third condition and is still showing related worksheets with "Hidden" in Column I.</p>