You can use the onEdit() trigger of Google Apps Script to capture changes in the sheet and then use a conditional statement to check if the value of the cell has changed from false to true. If the condition is met, you can set the adjacent cell value to "true" using the setValue() method. Here's a sample code:
function onEdit(e) {
var sheet = e.source.getActiveSheet();
var range = e.range;
if (range.getColumn() == 1 && range.getRow() > 1 && range.getValue() == true && range.offset(0, 1).getValue() == false) {
range.offset(0, 1).setValue("true");
}
}
This code checks if the edited range is in column 1 (change this as per your requirement) and the value of the cell has changed from false to true. If the condition is met, it sets the adjacent cell value to "true". You can modify the code as per your specific requirements.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2021-12-28 11:00:00 +0000
Seen: 9 times
Last updated: Jan 18 '22
How can unstaged work be resolved in two working directories using Git?
How can you retrieve lost uncommitted changes using "git reset --hard"?
How can notifications for changes in nested properties of a Realm object be implemented?
What changes need to be made to this for loop to be suitable for use with Pandas, Modin, or Ray?
Why is Nodemon syncing but not restarting in Docker?
What changes do I need to make in the netcat command line to send multiple requests simultaneously?