How to get the target cell row number in the sheet with Google-apps-script -
i want create google-apps-script in google sheet.
first need target cell row number, continue next step.
i have tried getrow()
and getrowindex()
,all of them return 0, tell me what's right method...
var ss = spreadsheetapp.getactivespreadsheet(); var sheets = ss.getsheets(); var sheet1 = sheets[0]; var cell = sheet1.getactivecell(); var selectrow = cell.getrow(); logger.log("selectrow :" & selectrow);
i want return number 2.
thank in advance.
the problem logger.log("selectrow :" & selectrow);
. use +
instead of &
string concatenation , variable displayed properly.
use:
logger.log("selectrow :" + selectrow);
or this:
logger.log("selectrow : %s", selectrow);
Comments
Post a Comment