title: Copy Row to New Sheet then Empty Old Row, Google Spreadsheets
body: <p>I am still learning javascript so excuse me for probably a stupid question. 
  I searched for the title of my question and the closest I found was this link: 
  <a href="https://stackoverflow.com/questions/40773583/google-sheets-copy-and-paste-row-into-another-sheet-and-then-delete-content-from">Google Sheets copy and paste row into another sheet and then delete content from the first sheet</a></p>
  
  <p>What I need to do is to search for the word "Kicked" in this google sheet: 
  <a href="https://docs.google.com/spreadsheets/d/1UM3sZ3AK6_-khzfNgyyYesn56DrkKS2zSV20zorzpPg/edit?usp=sharing" rel="nofollow noreferrer">https://docs.google.com/spreadsheets/d/1UM3sZ3AK6_-khzfNgyyYesn56DrkKS2zSV20zorzpPg/edit?usp=sharing</a>
  from columns F to AJ in rows 2 to 101 so my search range is F2:AJ101. </p>
  
  <p>the current code I use in the script is as follows: </p>
  
  <pre><code>function onEdit(e) {    
  var sheet=e.range.getSheet();
  if (sheet.getSheetName() == 'Test') {
    logSheet = e.source.getSheetByName('Kicked');
    var row = e.range.getRow(); 
    var lastRow = logSheet.getLastRow();
    var range = sheet.getRange(row, 1, 1, sheet.getLastColumn()); 
    range.copyTo(logSheet.getRange(lastRow+1,1),{contentsOnly:true});
    sheet.clearContent();
  }
  </code></pre>
  
  <p>}
  }</p>
  
  <p>However, the code does not empty the row once it is copied to the new sheet. 
  If anyone can help me, I would really appreciate it. </p>