title: Excel odd rows give value
body: <p>I am trying to assign a value to all the odd cells in a particular column/range. So far I have the following code taken from another question, but it isnt working:</p>
  
  <pre><code>Sub changeClass()
  
      Dim r As Range
      Set r = Range("B16").End(xlDown)  'set the range the data resides in
  
  
      For i = 1 To r.Rows.Count  'merge step
          If i Mod 2 = 1 Then   'this checkes to see if i is odd
              r.Cells.Value = "value"
          End If
          Else 
              r.Cells.Value = "value2"
      Next i
  
  
  End Sub
  </code></pre>
  
  <p>Basically I need it to add in a value for every cell in the B column from cell 16 down to the last cell i nthe column which has data in. On the even rows the value will be one thing, on the odd it will be another. </p>
  
  <p>Many thanks!</p>