Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I pass a cell argument from a spreadsheet to a custum function as a range?

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

like image 868
user1663032 Avatar asked Sep 11 '12 13:09

user1663032


People also ask

How do you specify a range in Excel?

Press F5 or CTRL+G to launch the Go To dialog. In the Go to list, click the name of the cell or range that you want to select, or type the cell reference in the Reference box, then press OK. For example, in the Reference box, type B3 to select that cell, or type B1:B3 to select a range of cells.

Is it possible to create a custom function that can be used from within Excel?

A custom function must start with a Function statement and end with an End Function statement. In addition to the function name, the Function statement usually specifies one or more arguments. You can, however, create a function with no arguments.


1 Answers

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.

like image 190
Eric Koleda Avatar answered Sep 21 '22 17:09

Eric Koleda