答案 0 :(得分:0)
你可以让这更简单。不需要创建新阵列。尝试:
function copier() {
var ss=SpreadsheetApp.getActiveSpreadsheet()
var s=ss.getActiveSheet()
var lr=s.getLastRow() //get last row with data
var liste = s.getRange(3,2,lr-2,1).getValues(); //get values row 3, column B (2), last row minus 2 header rows, 1 column
s.getRange(3, 6, lr-2, 1).setValues(liste).setBackground("#97ebff") // set values and background color in column F
}
function effacer() {
var classeur = SpreadsheetApp.getActiveSpreadsheet();
var sheet = classeur.getActiveSheet();
sheet.getRange('f3:f').clearContent().clearFormat();
}