我正在尝试通过从电子表格单元格调用以下函数来使其工作:
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.