title: Enter a formula into cells with VBA
body: <p>Ok, so this is likely the combination of a number of existing questions, but here goes...</p>
  
  <p>I have a requirement to copy data from one sheet to another, then change some data, then add a column to the end with the following:</p>
  
  <pre><code>=if(G2="+",1,0)
  </code></pre>
  
  <p>This then needs to run down the entirety of the dataset, but the number of rows varies.</p>
  
  <p>Is there a way I can get this formula to appear next to every row that contains data and no further using vba?</p>