Excel.ListDataValidation interface
Represents the List data validation criteria.
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
function applyList(sheet: Excel.Worksheet) {
// Value must be chosen from the predefined list.
const listRule: Excel.ListDataValidation = {
inCellDropDown: true,
source: "Apple,Banana,Cherry"
};
const rule: Excel.DataValidationRule = { list: listRule };
sheet.getRange("B4").dataValidation.rule = rule;
}
Properties
| in |
Specifies whether to display the list in a cell drop-down. The default is |
| source | Source of the list for data validation When setting the value, it can be passed in as a |
Property Details
inCellDropDown
Specifies whether to display the list in a cell drop-down. The default is true.
inCellDropDown: boolean;
Property Value
boolean
Remarks
source
Source of the list for data validation When setting the value, it can be passed in as a Range object, or a string that contains a comma-separated number, Boolean, or date.
source: string | Range;
Property Value
string | Excel.Range