title: VBA *For Each Cell Loop* IF (Value in Column 1) = x AND IF (Equivalent Value In Column 2) >7 THEN
body: <p>I am having an issue with VBA that I can't seem to find an answer to online. I only started teaching myself a couple of weeks ago so apologies if this is a fairly simple answer...</p>
  
  <p>I am trying to write a macro where the entire row is un-coloured (Is that a word??) based on a value in column E and the equivalent value in column AN (same row). What I have so far is:</p>
  
  <pre><code>For Each cell In Sheets(5).Range("E9:E" &amp; LastRow)
  
  If (cell.Value = "BA" Or cell.Value = "NH" Or cell.Value = "AD") Then
      If ActiveCell.Offset(0, 35) &gt; 7 Then
            cell.EntireRow.Interior.color = xlNone
  End If
  Next cell
  </code></pre>
  
  <p>The only problem is, when I try to run it gives the 'Compile error: Next without For' error message.</p>
  
  <p>?? Am I missing something... there is a 'For'...</p>
  
  <p>If I remove the below line then the code runs,</p>
  
  <pre><code>If ActiveCell.Offset(0, 35) &gt; 7 Then
  </code></pre>
  
  <p>but it's not the output i require as all of the BA, NH &amp; AD values in column A have their entire row un-coloured regardless of whether they are >7 or &lt;7.</p>
  
  <p>Is the error caused by the IF-THEN-IF statement?</p>