title: Copy and Pasting a Moving Range in Google Sheets
body: <p>I'm very much still learning the basics of script writing, but I have a rather specific question that I've not been able to find a solution for - perhaps because I might be phrasing it wrong.</p>
  
  <p>Essentially, In sheet <code>MS</code>, I have a range of data (<code>A2:O23</code>) with formulas that I want to stay fixed (as in, always reference the same range in a different sheet).</p>
  
  <p>My aim is, at the run of a script, that this block of formulas will copy and paste from the next empty row (in the same columns [<code>A:O</code>]) and that the previous block (<code>A2:O23</code>) will copy and paste over itself as values.</p>
  
  <p>Then, each time the script runs, it does the same thing, copying the latest block of 22 rows beneath itself and pasting itself as values. Essentially having the effect of building a long list of data with the latest (read lowest) range being the formulas and all above being values.</p>
  
  <p>For example, the results of the first time it runs should be that, <code>A24:O45</code>now show the same formula and that <code>A2:O23</code> are showing as values only. The next time, <code>A24:O45</code> would be frozen as values and <code>A46:O67</code> are now the formulas.</p>
  
  <p>I'm not sure if this requires the use of loops or there is a different way to achieve the effect, but the former is something I've not used and the latter is still a mystery to me.</p>
  
  <p>I realise that this might not be especially clear, but I'm happy to field any questions and greatly appreciate any efforts made to help.</p>
  
  <p>Thanks</p>