Excel.DateTimeDataValidation interface

表示日期数据验证条件。Represents the Date 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. 设置值时, 可以将其作为日期、Range 对象或字符串公式 (其中字符串是字符串化的日期/时间, 格式为 "= A1") 或公式 (如 "= MIN (A1, B1)") 传入。When setting the value, it can be passed in as a Date, a Range object, or a string formula (where the string is either a stringified date/time in ISO8601 format, 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 对象或字符串 (其中字符串为字符串化的日期/时间, 格式为 ISO8601, 一个单元格引用, 如 "= A1") 或公式 (如 "= MIN (A1, B1)") 传递。When setting the value, it can be passed in as a Date, a Range object, or a string (where the string is either a stringified date/time in ISO8601 format, 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. 设置值时, 可以将其作为日期、Range 对象或字符串公式 (其中字符串是字符串化的日期/时间, 格式为 "= A1") 或公式 (如 "= MIN (A1, B1)") 传入。When setting the value, it can be passed in as a Date, a Range object, or a string formula (where the string is either a stringified date/time in ISO8601 format, 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 | Date | Range;

属性值

string | Date | 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 对象或字符串 (其中字符串为字符串化的日期/时间, 格式为 ISO8601, 一个单元格引用, 如 "= A1") 或公式 (如 "= MIN (A1, B1)") 传递。When setting the value, it can be passed in as a Date, a Range object, or a string (where the string is either a stringified date/time in ISO8601 format, 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 | Date | Range;

属性值

string | Date | 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"