Excel.DataValidationType enum
Represents the data validation type enum.
Remarks
Used by
Examples
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/22-data-validation/data-validation-types.yaml
await Excel.run(async (context) => {
// Get the data validation type of the currently selected range.
const range = context.workbook.getSelectedRange();
range.load("address");
range.dataValidation.load("type");
await context.sync();
const validationType: Excel.DataValidationType = range.dataValidation.type as Excel.DataValidationType;
console.log(`Data validation type for ${range.address}: ${validationType}`);
});
Fields
| custom = "Custom" | The custom data validation type. |
| date = "Date" | The date data validation type. |
| decimal = "Decimal" | The decimal data validation type. |
| inconsistent = "Inconsistent" | Inconsistent means that the range has inconsistent data validation, indicating that there are different rules on different cells. |
| list = "List" | The list data validation type. |
| mixedCriteria = "MixedCriteria" | Mixed criteria means that the range has data validation present on some but not all cells. |
| none = "None" | None means allow any value, indicating that there is no data validation in the range. |
| textLength = "TextLength" | The text length data validation type. |
| time = "Time" | The time data validation type. |
| wholeNumber = "WholeNumber" | The whole number data validation type. |