I am setting up a script to copy data from one location and paste values into another location (same tab). However it is only picking up the first line. How can i get it to pick up the whole range ?
function moveValuesOnly() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var source = ss.getRange("RUNSHEET!H4:AC20");
var destSheet = ss.getSheetByName("RUNSHEET");
destSheet.appendRow(source.getValues()[0]);
}
Best Answer
You have to remove
by something else because
appendRow
only adds one row of valuesand
returns only the values of first row of
source
That something else could be one of the methods
getRange
and thensetValues(source.getValues())
or you could usecopyTo
There are a lot of examples on this site.
Reference