title: Assign formula to cell using VBA?
body: <p>VBA has been giving me an error <code>1004</code> for this code:</p>
  
  <pre><code>Sub UpdateCellsFormula()
  Dim FormulaRange As Range
  Dim i As Integer
  
  Set FormulaCellsRange = Range("J17", "J95")
  i = 17
  
  For Each r In FormulaCellsRange.Cells
      r.Formula = Replace("=D17*L21+E17*M21+F17*O21+G17*N21+H17*P21+I17*Q21)/(1+0,85+0,6+0,4+0,37)", "17", i)
      i = i + 1
  Next
  End Sub
  </code></pre>
  
  <p>Can anyone have a look at it?</p>