title: Excel VBA: Iterating over range parameter and change cell values
body: <p>I believe what I am trying to do is pretty simple. I want to iterate over a Range parameter and change the value for each cell in that range.</p>
  
  <pre><code>Function test(thisRange As Range)
      For Each c In thisRange.Cells
           c.Value = 1
      Next
  End Function
  </code></pre>
  
  <p>The above is a simple example of what I want to do, but doesn't seem to work. When I debug this, Excel seems to be throwing an error when it hits <code>c.Value = 1</code>. Why does this not work?</p>