使用Apps脚本在Google表格中放置复选框 [英] Placing checkboxes in Google Sheets using Apps Script

查看:74
本文介绍了使用Apps脚本在Google表格中放置复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道复选框是Google表格中的一个相对较新的功能,因此,我试图找到一种在单元格中自动创建复选框的方法。

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.

到目前为止,我还没有在Google Apps脚本文档中找到与此相关的参考。

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.

推荐答案

UPDATE(2019年4月)


您现在可以直接 insertCheckboxes (或 上的removeCheckboxes )范围 RangeList ,没有任何解决方法。您还可以使用文档中提供的替代方法签名来更改检查值/未检查值。

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.

SpreadsheetApp.getActive()
    .getRange('Sheet2!A2:A10')
    .insertCheckboxes();

这篇关于使用Apps脚本在Google表格中放置复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆