How do I pass a cell argument from a spreadsheet t

2019-01-28 03:42发布

问题:

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
}

What should I do?

Dror

回答1:

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.