Hello Sir, thanks for this tutorial video, but i have an issue, why data thats been moved to target sheet becomes duplicate? im following all way that you show on video
Typically if you have an issue with duplicates, it's when multiple edits are being made to the sheet, and so the script is running multiple times at the essentially same time. If there are multiple people in the Google Sheet at the same time, you might have to take a different approach and run a script at night to make the necessary transfers. Otherwise another approach is to use a script lock so its only running one at a time, but if you have multiple people making edits at the same time, this can also result in some weird and unexpected behavior.
Hello Sir, I have been having difficulties trying to get this script to work properly. I type it out exactly the same way you show it here on the video and I continue to receive an Error stating TypeError : Cannot read properties of undefined (reading 'range') Please HELP!!!
When you authorize the script or run it manually from the script editor, you will get that error, the question is if the function is now working on the spreadsheet?
That will happen when you authorize the script, because the onEdit is designed to run when the spreadsheet is edited and then "e" will contain info about the edit event that caused it to run. So the script should run now if you make an edit in the Google Sheet.
So if you don't have edit access to a sheet or tab, all you can do is copy data, not move it. If you want to copy the last row from a tab and move to the top of the next sheet, you'll just want to use this: let data = sourceSheet.getRange(sourceSheet.getLastRow(),1,1, sourceSheet.getLastColumn()).getValues(); targetSheet.insertRowBefore(2) targetSheet.getRange(2,1,1,data[0].length).setValues(data);
Hello Sir, thanks for this tutorial video, but i have an issue, why data thats been moved to target sheet becomes duplicate? im following all way that you show on video
Typically if you have an issue with duplicates, it's when multiple edits are being made to the sheet, and so the script is running multiple times at the essentially same time. If there are multiple people in the Google Sheet at the same time, you might have to take a different approach and run a script at night to make the necessary transfers.
Otherwise another approach is to use a script lock so its only running one at a time, but if you have multiple people making edits at the same time, this can also result in some weird and unexpected behavior.
Hey there, what happens if you make a mistake and want to get the row back to the master list?
You'd have to add the script to the sheet it got moved to as well, and then basically take the same action on the target sheet
@@SheetsNinja thanks for the prompt response!
Hello Sir,
I have been having difficulties trying to get this script to work properly.
I type it out exactly the same way you show it here on the video and I continue to receive an Error stating
TypeError : Cannot read properties of undefined (reading 'range')
Please HELP!!!
When you authorize the script or run it manually from the script editor, you will get that error, the question is if the function is now working on the spreadsheet?
@@SheetsNinja No unfortunately the function is still not working on the spread sheet.
HI, I want to ask you if I want to copy to other sheet , but keep old data
All you do is remove the line of code that says:
sheet.deleteRow(row);
I have an error, the let range = e.range;
TypeError: Cannot read properties of undefined (reading 'range')
That will happen when you authorize the script, because the onEdit is designed to run when the spreadsheet is edited and then "e" will contain info about the edit event that caused it to run. So the script should run now if you make an edit in the Google Sheet.
add trigger
hello sir, i have problem to move data on protected sheet and last data move to top in next sheet so please help me.
So if you don't have edit access to a sheet or tab, all you can do is copy data, not move it. If you want to copy the last row from a tab and move to the top of the next sheet, you'll just want to use this:
let data = sourceSheet.getRange(sourceSheet.getLastRow(),1,1, sourceSheet.getLastColumn()).getValues();
targetSheet.insertRowBefore(2)
targetSheet.getRange(2,1,1,data[0].length).setValues(data);