title: x = x + y formula returning 0 in Excel VBA
body: <p>While running the following code the variable intEarn does not change from <em>0</em> when adding on a formula onto itself in the style of <code>intEarn = intEarn + (...)</code>.</p>
  
  <p>I have placed message boxes throughout the code to see exactly what is being computed each time and for whatever reason it seems that the <code>intEarn = intEarn + (...)</code> always results in 0 no matter what is in the <code>(...)</code>.</p>
  
  <pre><code>Dim ovr As Range
  Set ovr = cells.Find("Overview").Offset(2, 0)
  Dim intEarn As Long
  intEarn = 0
  
  ...
  
  x = 0
  Do until IsEmpty(ovr.Offset(x, 0))
          'The following line results in 0
          intEarn = intEarn + (ovr.Offset(x, 0).Offset(0, 1).Value * ovr.Offset(x,0).Offset(0, 2).Value)
          'While the next line of code results in the proper number
          MsgBox ("Correct: " &amp; ovr.Offset(x, 0).Offset(0, 1).Value * ovr.Offset(x, 0).Offset(0, 2).Value)
          x = x + 1
  Loop
  </code></pre>
  
  <p>I expected the first output of <code>intEarn = intEarn + (ovr.Offset(x, 0).Offset(0, 1).Value * ovr.Offset(x,0).Offset(0, 2).Value</code> to equal <strong>0.327</strong> since <code>ovr.Offset(x, 0).Offset(0, 1).Value</code> = <strong>1090</strong> and <code>ovr.Offset(x, 0).Offset(0, 2).Value</code> = <strong>.03%</strong>.</p>