Answer the question
In order to leave comments, you need to log in
Automatic creation of checkbox in google sheets, how to do?
I can't think of a script, macro, or formula to automatically create a checkbox. The bottom line: for example, cell A1 is empty, and as soon as any value appears in it, an empty checkbox appears in cell B1. Please tell me how to do it.
Answer the question
In order to leave comments, you need to log in
function onEdit(e) {
let sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
let row = e.range.getRow();
let column = e.range.getColumn();
let value = e.source.getActiveSheet().getRange(row, 1).getValue();
let checkbox = SpreadsheetApp.newDataValidation().requireCheckbox().setAllowInvalid(false).build();
if (column == 1 && value !== "") {
sheet.getRange(row, 2).setDataValidation(checkbox).setValue(false);
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question