0

I have hundreds of checkboxes in multiple sheets on a single Google Sheets project.

When a user clicks a checkbox, I want a script to activate.

In that script, I need to know what cell the checkbox that was clicked is in. Is there a way to do this without making a hundred different scripts for each checkbox and hard-coding the location of each of those cells?

For example if I clicked on this checkbox

enter image description here

I would want my script to know that it was activated from Sheet12:B2. If the specific sheet is not possible, then just the cell location (B2 in this case) is sufficient.

New contributor
Hatefiend is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
1

Use on edit / on change triggers and the corresponding event object.

Example

function onEdit(e){
  var a1Notation = e.range.getA1Notation();
  e.source.toast(a1Notation + ' was clicked');
}

Related

References

Your Answer

Hatefiend is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.