google sheets calulation latency and dependant function calls
问题 Here is a function that pupulates a column with a formula: function fillAccount(lastRow) { var spreadsheet = SpreadsheetApp.getActive(); spreadsheet.getRange('B1').activate(); spreadsheet.getCurrentCell().setValue(' '); spreadsheet.getRange('B2').activate() .setFormula('=ifna(vlookup(C2,Accounts!$A$1:$A$7,1,false),B1)'); spreadsheet.getRange('B3').activate(); var currentCell = spreadsheet.getCurrentCell(); spreadsheet.getRange('B3:B' + lastRow).activate(); spreadsheet.getRange('B2').copyTo