Access cell coordinates in user-defined function

Is there a way to access the coordinates of the cell (in A1 notation) of the cell that was passed to my function?

For example, if my function is

function displayA1Notation(myCell){ return myCell.getA1Notation(); } 

and I will put the following in cell B4:

 =displayA1Notation(C6) 

I hope to see this:

 C6 

But I really see this:

 Kansas 

("Kansas" is the actual value of cell C6)

I know this seems easy ... I was just stuck trying to get it to work.

Thanks ~!

+4
source share
1 answer

Arguments for custom spreadsheet functions contain only values ​​that are designated as arguments, not cell addresses. This fact is not clear, but there are several similar questions, for example, this one . There is a workaround with the built-in ADDRESS function. as in the following code

 =myFunc(ADDRESS(ROW(F8), COLUMN(F8))) 
+1
source

Source: https://habr.com/ru/post/1442439/


All Articles