设置单元格公式Google Script时出现REF错误

问题描述 投票:0回答:1

我使用apps脚本创建了一个名为=matchlist的自定义函数。该功能没有问题。我还创建了另一个名为refreshTBA的函数,它清除某个单元格的内容(A2)并用公式=matchlist(Setup!$b$2)替换它。当我打开表单时运行此功能时,没有问题。但是,每当我离开页面并打开它时,单元格中的功能就是=matchlist(#REF)

这是refreshTBA函数的代码:

function refreshTBA() {
  var ss = SpreadsheetApp.getActive().getSheetByName("MatchImport")
  var cell = ss.getRange("A2")
  cell.clearContent()
  cell.setFormula('=matchlist(Setup!$b$2)')
  var cell = ss.getRange("A300")
  cell.clearContent()
  cell.setValue('Refreshed') 
}
google-apps-script google-sheets google-sheets-formula
1个回答
1
投票

感谢Google产品论坛的帮助,我解决了这个问题。

使用qazxsw poi参数放置公式时,不需要包含等号。如果我使用qazxsw poi那么我应该

© www.soinside.com 2019 - 2024. All rights reserved.