Excel.BasicDataValidation interface

表示基本类型数据验证条件。Represents the Basic Type data validation criteria.

[API 集: ExcelApi 1.8][ API set: ExcelApi 1.8 ]

属性

formula1

当 operator 属性设置为二元运算符 (如 GreaterThan (左边的操作数是用户试图在单元格中输入的值) 时, 指定右边的操作数。Specifies the right-hand operand when the operator property is set to a binary operator such as GreaterThan (the left-hand operand is the value the user tries to enter in the cell). 使用和 NotBetween 之间的三元运算符指定下界操作数。With the ternary operators Between and NotBetween, specifies the lower bound operand. 例如, 将 formula1 设置为 10 and operator to GreaterThan 意味着该范围的有效数据必须大于10。For example, setting formula1 to 10 and operator to GreaterThan means that valid data for the range must be greater than 10. 设置值时, 可以将其作为数字、range 对象或字符串公式 (其中字符串是字符串化数字、像 "= A1" 的单元格引用或公式 (如 "= MIN (A1, B1)") 一起传递。When setting the value, it can be passed in as a number, a range object, or a string formula (where the string is either a stringified number, a cell reference like "=A1", or a formula like "=MIN(A1, B1)"). 检索值时, 它将始终以字符串公式的形式返回, 例如: "= 10"、"= A1"、"= SUM (A1: B5)" 等。When retrieving the value, it will always be returned as a string formula, for example: "=10", "=A1", "=SUM(A1:B5)", etc.

[API 集: ExcelApi 1.8][ API set: ExcelApi 1.8 ]

formula2

使用和 NotBetween 之间的三元运算符指定上界操作数。With the ternary operators Between and NotBetween, specifies the upper bound operand. 不与二元运算符 (如 GreaterThan) 一起使用。Is not used with the binary operators, such as GreaterThan. 设置值时, 可以将其作为数字、range 对象或字符串公式 (其中字符串是字符串化数字、像 "= A1" 的单元格引用或公式 (如 "= MIN (A1, B1)") 一起传递。When setting the value, it can be passed in as a number, a range object, or a string formula (where the string is either a stringified number, a cell reference like "=A1", or a formula like "=MIN(A1, B1)"). 检索值时, 它将始终以字符串公式的形式返回, 例如: "= 10"、"= A1"、"= SUM (A1: B5)" 等。When retrieving the value, it will always be returned as a string formula, for example: "=10", "=A1", "=SUM(A1:B5)", etc.

[API 集: ExcelApi 1.8][ API set: ExcelApi 1.8 ]

operator

用于验证数据有效性的运算符。The operator to use for validating the data.

[API 集: ExcelApi 1.8][ API set: ExcelApi 1.8 ]

属性详细信息

formula1

当 operator 属性设置为二元运算符 (如 GreaterThan (左边的操作数是用户试图在单元格中输入的值) 时, 指定右边的操作数。Specifies the right-hand operand when the operator property is set to a binary operator such as GreaterThan (the left-hand operand is the value the user tries to enter in the cell). 使用和 NotBetween 之间的三元运算符指定下界操作数。With the ternary operators Between and NotBetween, specifies the lower bound operand. 例如, 将 formula1 设置为 10 and operator to GreaterThan 意味着该范围的有效数据必须大于10。For example, setting formula1 to 10 and operator to GreaterThan means that valid data for the range must be greater than 10. 设置值时, 可以将其作为数字、range 对象或字符串公式 (其中字符串是字符串化数字、像 "= A1" 的单元格引用或公式 (如 "= MIN (A1, B1)") 一起传递。When setting the value, it can be passed in as a number, a range object, or a string formula (where the string is either a stringified number, a cell reference like "=A1", or a formula like "=MIN(A1, B1)"). 检索值时, 它将始终以字符串公式的形式返回, 例如: "= 10"、"= A1"、"= SUM (A1: B5)" 等。When retrieving the value, it will always be returned as a string formula, for example: "=10", "=A1", "=SUM(A1:B5)", etc.

[API 集: ExcelApi 1.8][ API set: ExcelApi 1.8 ]

formula1: string | number | Range;

属性值

string | number | Range

formula2

使用和 NotBetween 之间的三元运算符指定上界操作数。With the ternary operators Between and NotBetween, specifies the upper bound operand. 不与二元运算符 (如 GreaterThan) 一起使用。Is not used with the binary operators, such as GreaterThan. 设置值时, 可以将其作为数字、range 对象或字符串公式 (其中字符串是字符串化数字、像 "= A1" 的单元格引用或公式 (如 "= MIN (A1, B1)") 一起传递。When setting the value, it can be passed in as a number, a range object, or a string formula (where the string is either a stringified number, a cell reference like "=A1", or a formula like "=MIN(A1, B1)"). 检索值时, 它将始终以字符串公式的形式返回, 例如: "= 10"、"= A1"、"= SUM (A1: B5)" 等。When retrieving the value, it will always be returned as a string formula, for example: "=10", "=A1", "=SUM(A1:B5)", etc.

[API 集: ExcelApi 1.8][ API set: ExcelApi 1.8 ]

formula2?: string | number | Range;

属性值

string | number | Range

operator

用于验证数据有效性的运算符。The operator to use for validating the data.

[API 集: ExcelApi 1.8][ API set: ExcelApi 1.8 ]

operator: Excel.DataValidationOperator | "Between" | "NotBetween" | "EqualTo" | "NotEqualTo" | "GreaterThan" | "LessThan" | "GreaterThanOrEqualTo" | "LessThanOrEqualTo";

属性值

Excel.DataValidationOperator | "Between" | "NotBetween" | "EqualTo" | "NotEqualTo" | "GreaterThan" | "LessThan" | "GreaterThanOrEqualTo" | "LessThanOrEqualTo"