How to find the row and column of a user-selected cell

194 views
Skip to first unread message

Rob Wilson

unread,
May 3, 2025, 2:01:51 PM5/3/25
to Google Apps Script Community
I'm developing a G  form & sheet for job entry. When a someone,  while viewing the form responses in a sheet, clicks on a particular job's number ( which is displayed in a cell) and then clicks a button, I want to run a function (that will print a job sheet).

I can't figure out how to code the condition for a cell in a range to be detected as "selected".
Thanks, Rob

Rob Wilson

unread,
May 3, 2025, 5:33:11 PM5/3/25
to Google Apps Script Community
I found a solution - I can use the getActiveCell() method, for example:
 var cell = srceSheet.getActiveCell();
  var row = cell.getRow();
  var column = cell.getColumn();


I didn't realise that Active and Selected mean different things ...
Reply all
Reply to author
Forward
0 new messages