Google Apps Script API
    Preparing search index...

    Builder for conditional format rules.

    // Adds a conditional format rule to a sheet that causes cells in range A1:B3 to turn red if
    // they contain a number between 1 and 10.
    var sheet = SpreadsheetApp.getActiveSheet();
    var range = sheet.getRange("A1:B3");
    var rule = SpreadsheetApp.newConditionalFormatRule()
        .whenNumberBetween(1, 10)
        .setBackground("#FF0000")
        .setRanges([range])
        .build();
    var rules = sheet.getConditionalFormatRules();
    rules.push(rule);
    sheet.setConditionalFormatRules(rules);
    
    interface ConditionalFormatRuleBuilder {
        build(): GoogleAppsScript.Spreadsheet.ConditionalFormatRule;
        copy(): ConditionalFormatRuleBuilder;
        getBooleanCondition(): GoogleAppsScript.Spreadsheet.BooleanCondition;
        getGradientCondition(): GradientCondition;
        getRanges(): GoogleAppsScript.Spreadsheet.Range[];
        setBackground(color: string): ConditionalFormatRuleBuilder;
        setBold(bold: boolean): ConditionalFormatRuleBuilder;
        setFontColor(color: string): ConditionalFormatRuleBuilder;
        setGradientMaxpoint(color: string): ConditionalFormatRuleBuilder;
        setGradientMaxpointWithValue(
            color: string,
            type: InterpolationType,
            value: string,
        ): ConditionalFormatRuleBuilder;
        setGradientMidpointWithValue(
            color: string,
            type: InterpolationType,
            value: string,
        ): ConditionalFormatRuleBuilder;
        setGradientMinpoint(color: string): ConditionalFormatRuleBuilder;
        setGradientMinpointWithValue(
            color: string,
            type: InterpolationType,
            value: string,
        ): ConditionalFormatRuleBuilder;
        setItalic(italic: boolean): ConditionalFormatRuleBuilder;
        setRanges(
            ranges: GoogleAppsScript.Spreadsheet.Range[],
        ): ConditionalFormatRuleBuilder;
        setStrikethrough(strikethrough: boolean): ConditionalFormatRuleBuilder;
        setUnderline(underline: boolean): ConditionalFormatRuleBuilder;
        whenCellEmpty(): ConditionalFormatRuleBuilder;
        whenCellNotEmpty(): ConditionalFormatRuleBuilder;
        whenDateAfter(
            date: GoogleAppsScript.Base.Date,
        ): ConditionalFormatRuleBuilder;
        whenDateAfter(date: RelativeDate): ConditionalFormatRuleBuilder;
        whenDateBefore(
            date: GoogleAppsScript.Base.Date,
        ): ConditionalFormatRuleBuilder;
        whenDateBefore(date: RelativeDate): ConditionalFormatRuleBuilder;
        whenDateEqualTo(
            date: GoogleAppsScript.Base.Date,
        ): ConditionalFormatRuleBuilder;
        whenDateEqualTo(date: RelativeDate): ConditionalFormatRuleBuilder;
        whenFormulaSatisfied(formula: string): ConditionalFormatRuleBuilder;
        whenNumberBetween(start: number, end: number): ConditionalFormatRuleBuilder;
        whenNumberEqualTo(number: number): ConditionalFormatRuleBuilder;
        whenNumberGreaterThan(number: number): ConditionalFormatRuleBuilder;
        whenNumberGreaterThanOrEqualTo(
            number: number,
        ): ConditionalFormatRuleBuilder;
        whenNumberLessThan(number: number): ConditionalFormatRuleBuilder;
        whenNumberLessThanOrEqualTo(number: number): ConditionalFormatRuleBuilder;
        whenNumberNotBetween(
            start: number,
            end: number,
        ): ConditionalFormatRuleBuilder;
        whenNumberNotEqualTo(number: number): ConditionalFormatRuleBuilder;
        whenTextContains(text: string): ConditionalFormatRuleBuilder;
        whenTextDoesNotContain(text: string): ConditionalFormatRuleBuilder;
        whenTextEndsWith(text: string): ConditionalFormatRuleBuilder;
        whenTextEqualTo(text: string): ConditionalFormatRuleBuilder;
        whenTextStartsWith(text: string): ConditionalFormatRuleBuilder;
        withCriteria(
            criteria: BooleanCriteria,
            args: any[],
        ): ConditionalFormatRuleBuilder;
    }
    Index

    Methods