Qu

xlsx.add_validation

Builtin index · File I/O

xlsx.add_validation(wb, sheet, range, kind, [values=], [source=], [min=], [max=], [formula=], [prompt=], [prompt_title=], [error=], [error_title=], [error_style="stop"], [allow_blank=true])

Input: wb, sheet, range, kind, values, source, min, max, formula, prompt, prompt_title, error, error_title, error_style, allow_blank · Output: no output

What it is

Restricts what can be typed into range. kind "list" offers a drop-down from values=[...] (no commas or quotes inside a value, 255 characters in all) or from the cells of source="D2:D9" (another sheet: "Lists!A1:A5"); "whole"/"decimal" take min=, max= or both (inclusive); "custom" takes formula=, written for the range's first cell ("=B2>A2"). prompt=/prompt_title= show when a cell is selected, error=/error_title= when a value is refused; error_style "warning" or "information" lets the user keep it anyway. Keywords that do not apply to kind are errors.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
xlsx.add_validation(wb, sheet, range, kind, [values=], [source=], [min=], [max=], [formula=], [prompt=], [prompt_title=], [error=], [error_title=], [error_style="stop"], [allow_blank=true])
wb —not documented yet
sheet Listkind "list" offers a drop-down from values=[...] (no commas or quotes inside a value, 255 characters in all) or from the cells of source="D2:D9" (another sheet: "Lists!A1:A5").
range —Restricts what can be typed into range.
kind Listkind "list" offers a drop-down from values=[...] (no commas or quotes inside a value, 255 characters in all) or from the cells of source="D2:D9" (another sheet: "Lists!A1:A5").
values List, optionalkind "list" offers a drop-down from values=[...] (no commas or quotes inside a value, 255 characters in all) or from the cells of source="D2:D9" (another sheet: "Lists!A1:A5").
source List, optionalkind "list" offers a drop-down from values=[...] (no commas or quotes inside a value, 255 characters in all) or from the cells of source="D2:D9" (another sheet: "Lists!A1:A5").
min optional"whole"/"decimal" take min=, max= or both (inclusive).
max optional"whole"/"decimal" take min=, max= or both (inclusive).
formula optional"custom" takes formula=, written for the range's first cell ("=B2>A2").
prompt optionalprompt=/prompt_title= show when a cell is selected, error=/error_title= when a value is refused.
prompt_title optionalprompt=/prompt_title= show when a cell is selected, error=/error_title= when a value is refused.
error optionalprompt=/prompt_title= show when a cell is selected, error=/error_title= when a value is refused.
error_title optionalprompt=/prompt_title= show when a cell is selected, error=/error_title= when a value is refused.
error_style optional (default "stop")error_style "warning" or "information" lets the user keep it anyway.
allow_blank optional (default true)not documented yet
no output—

Examples

No documentation example calls this form yet. The File I/O chapter is where one belongs.