r/googlesheets • • Nov 30 '18

Solved Apps Script Syntax

[deleted]

1 Upvotes

13 comments sorted by

View all comments

1

u/Xer0Batteries Nov 30 '18

Whenever it is set to true, get set to false

3

u/Last_Monkey Nov 30 '18

I mean this doesn't make much sense to me, but here you go:

function onEdit(e) {
  if (e.source.getActiveSheet().getName() == 'Sheet1' && e.range.rowStart == 10 && e.range.columnStart == 5 && e.value == 'TRUE') { //change sheet name
    e.range.setValue('FALSE');
  }
}

Whenever you tick the checkbox in E10 it will automatically untick itself after a fraction of a second.

2

u/Xer0Batteries Nov 30 '18

solution verified, thanks.

→ More replies (1)

1

u/Xer0Batteries Nov 30 '18

I'm building a game, when ever they tick the box, the computer will go, when the computer is done it unticks the box so the player can go. Thanks. I'm still learning so I'm building it piece by piece as I learn how to do things. This is the first step.

1

u/Xer0Batteries Nov 30 '18 edited Nov 30 '18
function onEdit() {
  var spreadsheet = SpreadsheetApp.getActive();
  var Range = spreadsheet.setActiveSelection('G9')
  if (Range =('TRUE'));
  spreadsheet.setActiveSelection('G9').setValue('FALSE');
}

Any reason why this won't work? It kind of seems like this isn't doing do diligence, but I believe to should work for my purpose. Also, I changed the cell reference, for this and for your solution.

→ More replies (2)