如何将电子表格中的单元格参数作为范围传递给 custum 函数? [英] How do I pass a cell argument from a spreadsheet to a custum function as a range?

查看:15
本文介绍了如何将电子表格中的单元格参数作为范围传递给 custum 函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

这篇关于如何将电子表格中的单元格参数作为范围传递给 custum 函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆