コード例 #1
0
# Optionally set a custom error message
dv_match.error = 'Your entry is not in the list'
dv_match.errorTitle = 'Invalid Entry'
# Optionally set a custom prompt message
dv_match.prompt = 'Please select from the list'
dv_match.promptTitle = 'List Selection'

# General column data validation
dv_general = DataValidation(type="list",
                            formula1='selections!$A$2:$A$7',
                            allow_blank=True)

# Optionally set a custom error message
dv_general.error = 'You have entered free text'
dv_general.errorTitle = 'Free Text'
dv_general.errorType = 'warning'

# Active Verb column data validation
dv_active = DataValidation(type="list",
                           formula1='selections!$B$2:$B$6',
                           allow_blank=True)

# Optionally set a custom error message
dv_active.error = 'You have entered free text'
dv_active.errorTitle = 'Free Text'
dv_active.errorType = 'warning'

# Focus column data validation
dv_focus = DataValidation(type="list",
                          formula1='selections!$C$2:$C$6',
                          allow_blank=True)