function myFunction222() {
// The code below copies only the values of the first 5 columns over to the 6th column.
var sheet = SpreadsheetApp.getActiveSheet();
sheet.getRange("A1").copyTo(sheet.getRange("F1"), SpreadsheetApp.CopyPasteType.PASTE_VALUES);
}
var tss = SpreadsheetApp.openById('15gKuDH--o1LIrWQ8b08pRPwjyDt0ad1KvHrlGrsKMbM'); // tss = target spreadsheet
var ts = tss.getSheetByName('Sheet2'); // ts = target sheet
//set the target range to the values of the source data
ts.getLastRow() + 1;
/**
*
*/
function onOpen() {
SpreadsheetApp.getUi()
.createMenu('Custom menussss')
.addItem('Copy to logs', 'CopyDataToNewFile')
.addToUi();
}
/**
*
*/function CopyDataToNewFile() {
var sss = SpreadsheetApp.openById('1fH8-jtH_GpvU17Ma9xl3ZmeOt8oPrBnj0G_MC5dQbtw'); // sss = source spreadsheet
var ss = sss.getSheetByName('Sheet1'); // ss = source sheet
//Get full range of data
var SRange = ss.getDataRange();
//get A1 notation identifying the range
var A1Range = SRange.getA1Notation();
//get the data values in range
var SData = SRange.getValues();
var tss = SpreadsheetApp.openById('15gKuDH--o1LIrWQ8b08pRPwjyDt0ad1KvHrlGrsKMbM'); // tss = target spreadsheet
var ts = tss.getSheetByName('Sheet2'); // ts = target sheet
//set the target range to the values of the source data
ts.getRange(A1Range).setValues(SData);
}