我如何通过从A S preadsheet细胞参数传递给函数俗为范围? [英] How do I pass a cell argument from a spreadsheet to a custum function as a range?

查看:117
本文介绍了我如何通过从A S preadsheet细胞参数传递给函数俗为范围?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让下面的函数从A S preadsheet单元调用它的工作:

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?

德罗尔

推荐答案

自定义函数只能访问到单元格的值,而不是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.

这篇关于我如何通过从A S preadsheet细胞参数传递给函数俗为范围?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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