主题
Operator (属性)
返回一个 int 值,它代表数据有效性的运算符。
示例
python
#本示例显示单元格 B1 的数据有效性的运算符是否为xlBetween
def test():
print(Range("B1").Validation.Operator == xlBetween)
python
#本示例判断活动工作表上 B1 单元格的数据有效性的运算符是否为xlGreater,并通知用户
def test():
validation = Application.ActiveSheet.Range("B1").Validation
if validation.Operator == xlGreater:
print("数据有效性的运算符为xlGreater")
else:
print("数据有效性的运算符不为xlGreater")