Bit of a rookie at this and learning atm. I am using the following script to copy data from one sheet to another in the same Google spreadsheet:
function recordHistory() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("Cover");
var source = sheet.getRange("a1:c21");
var values = source.getValues();
var sheet2 = ss.getSheetByName("January 2020")
values [0] [0] = new Date();
sheet2.appendRow(values [0])
}
Which works fine to copy a single row but does not copy the entire range listed (a1:c21). Now I imagine the problem lies around Row 8 but I am not sure.
Here is the link to the spreadsheet I am using for trying this out:
.appendRow()
, you're only adding one row of data by usingvalues[0]
. – ross