gpt4 book ai didi

google-apps-script - 如何在 Google Apps 脚本中创建动态下拉列表

转载 作者:行者123 更新时间:2023-12-04 18:18:10 25 4
gpt4 key购买 nike

我想使用 Google Apps 脚本动态更改 Google 电子表格的单元格验证功能中候选列表的值。
我未能使用 Google 公式功能在 Google 电子表格中创建动态下拉列表。

最佳答案

您现在可以使用 newDataValidation()建立数据验证规则。
例子:

// Set the data-validation rule for cell A1 to require a value from B1:B10.
var cell = SpreadsheetApp.getActive().getRange('A1');
var range = SpreadsheetApp.getActive().getRange('B1:B10');
var rule = SpreadsheetApp.newDataValidation().requireValueInRange(range)
.build();
cell.setDataValidation(rule);
来源: https://gsuite-developers.googleblog.com/2013/08/answering-another-top-request-data.html

关于google-apps-script - 如何在 Google Apps 脚本中创建动态下拉列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11304197/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com