title: Excel - Running IF/ELSE logic on user selection
body: <p>I want the run an IF/ELSE statement across the range of cells selected by the user.
  Currently which ever IF/ELSE statement is true for the first cell in the selection, is then applying to all the cells in the section rather than doing a for each loop.</p>
  <pre><code>Sub MultiCellTest()
    With Selection
      If ActiveCell &gt; 10 Then
          With Selection.Interior
              .Pattern = xlSolid
              .PatternColorIndex = xlAutomatic
              .Color = 6684927
              .TintAndShade = 0
              .PatternTintAndShade = 0
          End With
      Else
          With Selection.Interior
              .Pattern = xlSolid
              .PatternColorIndex = xlAutomatic
              .Color = 16764159
              .TintAndShade = 0
              .PatternTintAndShade = 0
          End With
      End If
  End With
  End Sub
  </code></pre>
  <p>Thanks.</p>