title: Excel VBA Next Without For
body: <p>The syntax of a new language can be difficult to mater. I am a 1 day old to VBA excel Wonder Where I am going wrong below.</p>
  
  <p>Trying to color rows in an selection  of Cells made by the user alternatively</p>
  
  <pre><code>Sub color()
      Dim R As Range
      Dim I As Integer
      Dim P As Object
      I = 1
      R = Selection
      For Each P In R
          If I Mod 2 = 0 Then
               P.Interior.ColorIndex = 36
          Else
              P.Interior.ColorIndex = 40
          I = I + 1
      Next P
  End Sub
  </code></pre>
  
  <p>The error I get is Next Without for</p>