title: Clear content and copy from another sheet
body: <p>I have written a script that intends to clear the content of a Google Sheets spreadsheet and copy and paste the content of another sheet.</p>
  
  <p>The sheet that needs to be cleared is called "NEW_SHEET" and the one to be copied over is called "Database".</p>
  
  <p>For some reason, the script is not working at the moment. Nothing happens when I run it.
  Also, at the moment, I am using <code>.getActiveRange</code> to select the range to clear. However, I would like that to be columns A to AC and only to the last row with data in it.</p>
  
  <p>This is the code I am using:</p>
  
  <pre><code>function importDB() {
    //Delete content of New Sheet
    var sh1 = SpreadsheetApp.openById('SHEET_ID').getSheetByName('NEW_SHEET')
    var range1 = sh1.getActiveRange()
    range1.clearContent()
  
    //Copy new database data
   var sh = SpreadsheetApp.openById('SHEET_ID').getSheetByName('Database')
     var range = sh.getDataRange();  
     var data = range.getValues();
     var ts = SpreadsheetApp.openById('SHEET_ID').getSheetByName('NEW_SHEET')
     ts.setValues(data)
  }
  </code></pre>