Questions tagged «google-sheets-custom-function»

12
如何将范围传递给Google Spreadsheets中的自定义函数?
我想创建一个函数,它需要一个范围...类似: function myFunction(range) { var firstColumn = range.getColumn(); // loop over the range } 单元格将使用以下方式引用它: =myFunction(A1:A4) 问题是,当我尝试执行此操作时,参数似乎只是将值传递给函数。因此,我不能使用任何Range方法,例如getColumn()。当我尝试这样做时,会出现以下错误: 错误:TypeError:在对象1,2,3中找不到函数getColumn。 如何将实际范围而不只是值发送到我的自定义函数之一?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.