-
Notifications
You must be signed in to change notification settings - Fork 541
excel validation add
zmworm edited this page Mar 21, 2026
·
51 revisions
Add data validation rules to cells and ranges.
Path: /{SheetName}
| Property | Default | Description |
|---|---|---|
sqref |
(required) | Target cell/range (e.g., A1, B2:B100) |
type |
list, whole, decimal, date, time, textLength, custom
|
|
formula1 |
First value/formula (list items, min value, start date, etc.) | |
formula2 |
Second value/formula (max value, end date, etc.) | |
operator |
between |
between, notBetween, equal, notEqual, greaterThan, lessThan, greaterThanOrEqual, lessThanOrEqual
|
allowBlank |
true |
Allow blank cells |
showError |
true |
Show error alert on invalid input |
errorTitle |
Error dialog title | |
error |
Error dialog message | |
showInput |
true |
Show input prompt when cell is selected |
promptTitle |
Input prompt title | |
prompt |
Input prompt message |
officecli add data.xlsx /Sheet1 --type validation \
--prop sqref=B2:B100 \
--prop type=list \
--prop formula1="Yes,No,Maybe" \
--prop promptTitle="Selection" \
--prop prompt="Choose from the list"officecli add data.xlsx /Sheet1 --type validation \
--prop sqref=C2:C100 \
--prop type=whole \
--prop operator=between \
--prop formula1=1 \
--prop formula2=100 \
--prop showError=true \
--prop errorTitle="Invalid" \
--prop error="Enter a number between 1 and 100"officecli add data.xlsx /Sheet1 --type validation \
--prop sqref=D2:D100 \
--prop type=date \
--prop operator=greaterThan \
--prop formula1=2024-01-01 \
--prop showError=true \
--prop errorTitle="Invalid Date" \
--prop error="Date must be after 2024-01-01"Based on OfficeCLI v1.0.11