title: Create a macro that is executed when a cel value chages (not by the user)
body: <p>Ok I have a worksheet "Goal 0" that with some ranges, make some calculations like...</p>
  
  <p>(in A1)</p>
  
  <pre><code>=SUM(G2:G68)*I17
  </code></pre>
  
  <p>Then if I add/modify any of the values in 62-G68, the cell is auto calculated (numbers that are mainly negative and some possitive).</p>
  
  <p>The objetive is: According to the sum of the range, find the value of I17 where the result of A1 is equal or more than 0. (Starting from 0, incrementing it 1 by 1, decimals not needed)</p>
  
  <p>Manually I can add change i17 untill it reaches the goal. How ever I want to make it automatically, so if a value in the range of G2 to G68 changes it recalculate the value of I17, untill (A1 calculation gets value equal or higher than 0) but if already is higger or equal than 0 then do nothing.</p>
  
  <p>Hope I explain it well</p>
  
  <p><strong>EDIT:</strong> Now I created this code ...</p>
  
  <pre><code>Function IncreaseTheValue()
      If Range("A1") &lt; 0 Then
          Range("I17").Value = 0
  
          Do While Range("A1").Value &lt; 0
              Range("I17").Value = Range("I17").Value + 1
          Loop
      End If
  End Function
  </code></pre>
  
  <p>And works perfect, how ever it does not fires when I make a chage. How do I do that...</p>
  
  <p>I try adding this in A2 cell but did not worked ...</p>
  
  <pre><code>=IF(A1 &lt; 0, IncreaseTheValue(), "")
  </code></pre>
  
  <p>Regards</p>