title: Getting 1004 error when setting a cell formula
body: <p>I have a macro that has to insert a new row each time a button is clicked.
  The thing is that some columns must have a formula in them, this one for example:</p>
  
  <pre><code>rating = "=IF(OR(ISBLANK($K$" &amp; lastRow &amp; ");ISBLANK($N$" &amp; lastRow &amp; ")); 0; $K$" &amp; lastRow &amp; "*VLOOKUP($N$" &amp; lastRow &amp; "; Parameter!$M$12:$N$16; 2))"
      .Cells(lastRow, 15).Formula = rating
  </code></pre>
  
  <p>I have tried to set the formula using <code>.Range("O" &amp; lastRow).Formula = rating</code>, but it doesn't work anyhow.
  Any ideas about how to fix it?</p>