title: how to use a sum function in vba
body: <p>I need to make  a function which calculates the formula:</p>
  
  <pre><code>Sigma(1/b^i)  i...n 
  </code></pre>
  
  <p>It asks the user to fill in i and n </p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>b = InputBox("give your calue for b")
  n = InputBox("give your value for n")
  
  For i = 1 To n
  
  answer = (1 / (b ^ i))
  
  
  Next i
  
  
  MsgBox ("" &amp; answer)
  </code></pre>
  
  <p>At the moment it only give the last iteration. How do I add all the iterations together?</p>
  
  <p>I hope someone can help me with this.</p>