【发布时间】:2022-10-17 06:41:27
【问题描述】:
此脚本/公式将两个相邻的列添加在一起(F 列和 G 列)并将其放在 H 列中以用于 google 表格中的所有表格,我需要进一步的帮助以使其仅计算 google 表格中的一些选定表格。
function runMacro() {
const sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets();
sheets.forEach(addFormula_);
}
function addFormula_(_sh) { const formulaString = '=Filter(F2:F+G2:G,F2:F<>"")'
const theAddress = 'H2';
_sh.getRange(theAddress).setFormula(formulaString);
}
【问题讨论】:
标签: google-apps-script google-sheets google-sheets-formula