Excel.ConditionalPresetCriteriaRule interface

Representa a regra de formatação condicional de critérios predefinidos

Propriedades

criterion

O critério do formato condicional.

Detalhes da propriedade

criterion

O critério do formato condicional.

criterion:
            | ConditionalFormatPresetCriterion
            | "Invalid"
            | "Blanks"
            | "NonBlanks"
            | "Errors"
            | "NonErrors"
            | "Yesterday"
            | "Today"
            | "Tomorrow"
            | "LastSevenDays"
            | "LastWeek"
            | "ThisWeek"
            | "NextWeek"
            | "LastMonth"
            | "ThisMonth"
            | "NextMonth"
            | "AboveAverage"
            | "BelowAverage"
            | "EqualOrAboveAverage"
            | "EqualOrBelowAverage"
            | "OneStdDevAboveAverage"
            | "OneStdDevBelowAverage"
            | "TwoStdDevAboveAverage"
            | "TwoStdDevBelowAverage"
            | "ThreeStdDevAboveAverage"
            | "ThreeStdDevBelowAverage"
            | "UniqueValues"
            | "DuplicateValues";

Valor da propriedade

| ConditionalFormatPresetCriterion | "Invalid" | "Blanks" | "NonBlanks" | "Errors" | "NonErrors" | "Yesterday" | "Today" | "Tomorrow" | "LastSevenDays" | "LastWeek" | "ThisWeek" | "NextWeek" | "LastMonth" | "ThisMonth" | "NextMonth" | "AboveAverage" | "BelowAverage" | "EqualOrAboveAverage" | "EqualOrBelowAverage" | "OneStdDevAboveAverage" | "OneStdDevBelowAverage" | "TwoStdDevAboveAverage" | "TwoStdDevBelowAverage" | "ThreeStdDevAboveAverage" | "ThreeStdDevBelowAverage" | "UniqueValues" | "DuplicateValues"

Exemplos

async function main(context: Excel.RequestContext) {
    let sheet = context.workbook.worksheets.getItem("Sample");
    let range = sheet.getRange("B2:M5");
    let conditionalFormat = range.conditionalFormats
        .add(Excel.ConditionalFormatType.presetCriteria);
    conditionalFormat.preset.format.font.color = "white";
    conditionalFormat.preset.rule = { criterion: Excel.ConditionalFormatPresetCriterion.oneStdDevAboveAverage };

    await context.sync();
}