title: Reference a range adding formulas with google scripts
body: <p>I think this is probably a basic issue, but I can't find the answer after trying hard.
  Both sheets are in the same workbook. </p>
  
  <p>In Sheet 'MER' I want to place a formula to reference cells in Sheet 'AVL"</p>
  
  <p>The first cell I want the script to place the formula is in B7 then again every 26th cell below, so B33, B59 and so on.</p>
  
  <p>I'm struggling as the script I'm using only picks up a single cell which is C3 in sheet 'AVL'. I want the script to go to C3, C4, C5, C6 etc. so in</p>
  
  <p>Sheet 'MER' </p>
  
  <pre><code>    B7=AVL!C3
      B33=AVL!C4
      B59=AVL!C5
  </code></pre>
  
  <p>And continue onwards. Here's the script I have, it just needs a bit of adjustment on the setFormula part...</p>
  
  <pre><code>function setFormulas() {
    var sheet = SpreadsheetApp.getActiveSheet();
    for (var k = 0; k &lt; 1000; k++) {
      sheet.getRange(7 + 26*k, 2).setFormula('=AVL!C3 ');
    }
  }
  </code></pre>
  
  <p>I've tried countless alterations ,+ 1' etc, but nothing works for me, and I can't find the answer via internet searches.</p>
  
  <p>Any help here greatly appreciated, thanks.</p>