Google sheets SpreadsheetApp插入带有标题和公式的新列
我需要在第5列之后插入一列,带有标题(平均点击次数),并且此列中的值必须根据公式(=E4*F4)计算。 我可以使用此选项在第5列之后插入列Google sheets SpreadsheetApp插入带有标题和公式的新列,google-sheets,Google Sheets,我需要在第5列之后插入一列,带有标题(平均点击次数),并且此列中的值必须根据公式(=E4*F4)计算。 我可以使用此选项在第5列之后插入列 sheet.insertColumns(5, 1); 是否可以使用页眉创建,还需要设置公式 谢谢您可以使用ArrayFormula函数将公式填充到多行中 function insertColumns() { var sheet = SpreadsheetApp.getActiveSheet(); sheet.insertColumnAfter(6)
sheet.insertColumns(5, 1);
是否可以使用页眉创建,还需要设置公式
谢谢您可以使用ArrayFormula函数将公式填充到多行中
function insertColumns() {
var sheet = SpreadsheetApp.getActiveSheet();
sheet.insertColumnAfter(6).getRange(1, 7).setValue("Average Clicks");
sheet.getRange(2,7).setFormula("=ArrayFormula(E2:E*F2:F)");
}
可以使用ArrayFormula函数将公式填充到多行中
function insertColumns() {
var sheet = SpreadsheetApp.getActiveSheet();
sheet.insertColumnAfter(6).getRange(1, 7).setValue("Average Clicks");
sheet.getRange(2,7).setFormula("=ArrayFormula(E2:E*F2:F)");
}