I have recently started doing some work in Google Sheets, where previously I have been able to code functions in Excel, I am unable to get this working in Google Sheets Scripting.
I have two sheets
Sheet 1. Cells A1 - E5 contain values based on some selection criteria Sheet 2. Register Sheet
What I need is when executing the script (via drawing and linked macro)
I need it to copy the range A1:E1
Go into Sheet 2, Go to the first Blank Cell in Column A, and then Paste Values.
I am using the following script, and I'm getting
coordinates of the target range are outside of the dimensions of the sheet.
function moveValuesOnly () {
var ss = SpreadsheetApp.getActiveSpreadsheet ();
var source = ss.getRange ("PNG Sheet!A1:E1");
var destSheet = ss.getSheetByName("Project Codes");
var destRange = destSheet.getRange(destSheet.getLastRow()+1,1);
source.copyTo (destRange, {contentsOnly: true});
source.clear ();
}
Any assistance would be greatly appreciated.
Cheers Graeme
setValues
with multiple row output. In general, you are correct - the sheet will not add rows. – tehhowch