我想使用 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/