Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Placing checkboxes in Google Sheets using Apps Script

Tags:

I know that checkbox is a relatively new feature in Google Sheets, so I'm trying to find a way to automatically create checkboxes in cells.

So far, I haven't found a reference regarding this in Google Apps Script documentation.

Currently I'm doing it manually, but any suggestion using script will be much appreciated.

like image 596
Zyre Soriano Avatar asked May 22 '18 11:05

Zyre Soriano


People also ask

Can you insert checkboxes in Google Sheets?

Add custom values in checkboxes In Sheets, select the cells you want to have checkboxes. Data validation. Next to Criteria, choose Checkbox. Select the Use custom cell values box.

How do I tick multiple checkboxes in Google Sheets?

Select All Checkboxes With Spacebar Highlight a range of checkboxes. Press the spacebar to toggle them checked or unchecked.


1 Answers

UPDATE(April 2019)

You can now directly insertCheckboxes(or removeCheckboxes) on a Range or RangeList without any workarounds. You can also change the checked value/unchecked value using alternate method signatures found in the documentation.

Snippet:

SpreadsheetApp.getActive()
    .getRange('Sheet2!A2:A10')
    .insertCheckboxes();
like image 141
TheMaster Avatar answered Sep 29 '22 13:09

TheMaster