Edit

Excel.ListDataValidation interface

Represents the List data validation criteria.

Remarks

API set: ExcelApi 1.8

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

inCellDropDown

Specifies whether to display the list in a cell drop-down. The default is true.

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.

Property Details

inCellDropDown

Specifies whether to display the list in a cell drop-down. The default is true.

inCellDropDown: boolean;

Property Value

boolean

Remarks

API set: ExcelApi 1.8

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

Remarks

API set: ExcelApi 1.8