I'm a new user of the Google Sheets and could use some help.
I have values in range A2:G2 on my currently active sheet. When the user clicks a button, I want those entered values to be copied into a 2nd sheet ('Sheet4') in the same main spreadsheet on the next open row.
I thought this would work, but the script is not finding the last row or adding the temptext values.
function button1(){
var activesheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var temptext = activesheet.getRange("A2:G2").getValue();
var activesheet2 = SpreadsheetApp.getActiveSpreadsheet();
activesheet2.setActiveSheet(activesheet2.getSheetByName('Sheet4'));
var lastrow = activesheet2.getLastRow(1);
activesheet2.getRange(lastrow + 1,1).setValue(temptext);
}