Can you insert a Macro command into a link?
I see you can create a button via "insert drawing" and additional script details but I like to click a link and it performs my macro.
CodePudding user response:
You could create a web app and use it's end point url to call any of your functions by name through the use of the parameters in the query string.
CodePudding user response:
You could use the onSelectionChange(event)
trigger. If you move the cursor and click on a cell it will tell you which cell was clicked and you could associate another function with that cell. If you click in the same cell it won't do anything.
However what I find is, although it is a simple trigger, you have to close and reopen the Spreadsheet for it to become active.
function onSelectionChange(event) {
// event = {"range":{"columnEnd":3,"columnStart":3,"rowEnd":1,"rowStart":1},"authMode":"LIMITED","source":{},"user":{"email":"[email protected]","nickname":"xxxx"}}
Logger.log(JSON.stringify(event));
}