有没有办法获取Google表格中所选单元格或范围的标识(即A1表示法)?
就像是:
=SELECTION(['Sheet1']) -> "D6"
最佳答案
在使用该功能更新单元格时,此自定义功能将获得选择。但是它不会随着选择的更改而更新。
Henrique很好地解释了为什么这样的自定义函数不会在Google Apps - script to summarise data not updating中更新。
/**
* A function that gets the current selection, in A1Notation.
*
* @customfunction
*/
function SELECTED_RANGE() {
return SpreadsheetApp.getActive().getActiveRange().getA1Notation();
}
关于google-apps-script - 如何获取当前选定的单元格/范围?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30779426/