小智 5
您可以通过在目标列中提供固定数量的单元格来实现这一点,假设目标列是L列,那么您可以使用以下代码片段:
sheet.dataValidations.add('L2:L9999', {
type: 'list',
allowBlank: false,
formulae: ['"male,female,other"'],
showErrorMessage: true,
errorStyle: 'error',
error: 'The value Valid',
});
Run Code Online (Sandbox Code Playgroud)
有关详细信息,请参阅以下内容: 如何对列 #1109 设置验证和 对整个列进行数据验证?第614章