如何将电子表格中的单元格参数作为范围传递给 custum 函数?如何将、单元格、函数、电子表格

由网友(我是深海请你溺水)分享简介:我正在尝试通过从电子表格单元格调用以下函数来使其工作:I'm trying to get the following function to work by calling it from a spreadsheet cell:=IsFormula(A1)function IsFormula(aCell) {ret...

我正在尝试通过从电子表格单元格调用以下函数来使其工作:

I'm trying to get the following function to work by calling it from a spreadsheet cell:

=IsFormula(A1)

function IsFormula(aCell) {

  return cell.getFormula().length != 0
}

我该怎么办?

医生

推荐答案

自定义函数只能访问单元格的值,不能访问 Range 对象本身.在您的情况下, aCell 将包含单元格的值,这不适用于您的用例.

Custom functions only have access to the cell's value, not the Range object itself. In your case, aCell would contain the value of the cell, which wouldn't work for your use case.

阅读全文

相关推荐

最新文章