在Google表格中,我正在编写一个使用offset函数的宏脚本:
例如 spreadsheet.getRange('G2').offset(0,1).activate();
但是,我需要它偏移特定单元格中显示的任何数字(在本例中为B29),而不是偏移静态列数。如何在偏移函数中引用B29的值?
尝试这样的事情:
const bvalue = spreadsheet.getRange('B29').getValue(); //get the value of B29
spreadsheet.getRange('G2').offset(0,bvalue).activate(); //pass it to the offset function
假设始终spreadsheet
是您已经定义的图纸对象。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句