title: How to call a function in a "For Each cell In Range" loop
body: <p>I want code that checks a cell to see if the sheet is in mode A or mode B, then check if the accessory is compatible with this mode. I have written this so far and it works except for when it calls the function.</p>
  <pre><code>For Each cell In Range(&quot;A1:A8&quot;)
  If cell.Value = &quot;Acessorie X&quot; The 
    If Range(&quot;B1&quot;).Value = &quot;Mode A&quot; The MsgBox (&quot;Warning: Acessorie X not compatible&quot;), , &quot;Invalid Entry&quot;
    Call function1(cell.Range)
  End If
  Next Cell
  </code></pre>