So I have followed instructions from multiple posts to create an AppsScript function that allows me to tally votes for responses in a shared google sheet. I am trying to create a collaborative form where employees can submit their feedback, and then instead of having multiples of that feedback additional employees who agree can click a button where it tallies the number of 'votes' that feedback has received.
I have gotten this to work for one row, but how do I use multiple 'increment' functions in the same sheet? Each function would represent responses from a different row, but as you probably know when you are selecting which function to attach to a button (drawing) you are only able to insert the name of the function, which would be the same 'increment' even though the functions are written differently...
Unfortunately I can't share the document because it is hosted on my work platform and I am unable to share it to the public.
Here is what I am working with- essentially I want to have multiple "Agree" buttons with the function representing only that row.
This is the code I have been using:
function increment() {
SpreadsheetApp
.getActiveSheet()
.getRange('C5')
.setValue(SpreadsheetApp.getActiveSheet().getRange('C5').getValue() + 1);
}
And the code would change to C6, C7, etc. for each row.
I have tried adding each increment code for every row in appscript and it will only tally in the last row. I have tried making separate increment codes on different tabs and it does the same thing.
Please help I have spend hours looking for a response and nothing has helped!
google sheet layout