How to run javascript byc clicking a cell in google sheets?
google-sheets, javascript
Solution
There is not an onClick event for cells but what you can do is instruct the user to enter your formula/custom function into the cell as described at https://developers.google.com/apps-script/execution_custom_functions?hl=es#using.
Similarly, you could have the cell pre-populated with the formula and simply ask the user to edit it and then press enter to run the function.
Problem
Google sheets allows you to write scripts in javascript, the same way excel lets you write VBA to automate tasks. I'd like to make a cell in my google spreadsheet clickable, so that when it is clicked, my function will run. I've found that it's possible to create custom buttons by inserting a drawing, but I'd really like this to be any time a particular cell is clicked, rather than a button which can move around and looks awkward in the sheet. Is it possible? Thanks for any advice.