title: Located a cell in the row following the last row and set a formula for an adjacent cell to equal it
body: <p>Here is my script. I am using this to locate the last row in my spreadsheet and then place data in the row below it. My problem is that I need the script to look at that row and determine what row number it is so that I can use that calculation to solve a following column.</p>
  
  <p>More precisely, I will place text in columns a-e of the lastrow+1. Column F will be left blank. I want to put a formula in column G that says =column F, so that once data is entered in F it will also be in column G. It needs to continously work as more cells placed at the bottom of the spreadsheet by running the script.</p>
  
  <p>Any help would be greatly appreciated.</p>
  
  <pre><code>function MH484020() {
  
      //Grab the active spreadsheet
  
      var ss = SpreadsheetApp.getActiveSpreadsheet();
      var sheet = ss.getActiveSheet();
  
      //Find the first last row with data in it
  
      var lastrow = sheet.getLastRow();
  
      //Use the last row with data in it to place forumulas below it
  
      var range = sheet.getRange(lastrow+1,2);
      range.setValue('DRAINAGE STR. 48-4020')
  
      var range = sheet.getRange(lastrow+1,3)
      range.setValue('484020')
  
      //Set data validation for steps or not
  
      var range = sheet.getRange(lastrow+1,4);
      var rule = SpreadsheetApp.newDataValidation().requireValueInList(['Yes','No'])
      .build();
      range.setDataValidation(rule);
  
      //Use the last row with data in it to place forumula for covers calculation
  
      var range = sheet.getRange(lastrow+1,6);
      return range;
      sheet.getRange(lastrow+1,7).setFormula("=range");
  </code></pre>