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: Google Sheets copy and paste row into another sheet and then delete content from the first sheet
What I need to do is to search for the word "Kicked" in this google sheet: https://docs.google.com/spreadsheets/d/1UM3sZ3AK6_-khzfNgyyYesn56DrkKS2zSV20zorzpPg/edit?usp=sharing from columns F to AJ in rows 2 to 101 so my search range is F2:AJ101.
the current code I use in the script is as follows:
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();
}
} }
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.