ExcelScript.ConditionalIconCriterion interface

Stellt ein Symbolkriterium dar, das einen Typ, einen Wert, einen Operator und ein optionales benutzerdefiniertes Symbol enthält, wenn kein Symbolsatz verwendet wird.

Hinweise

Beispiele

/**
 * This script applies icon set conditional formatting to a range.
 */
function main(workbook: ExcelScript.Workbook) {
  // Get the range "A1:A5" on the current worksheet.
  const sheet = workbook.getActiveWorksheet();
  const range = sheet.getRange("A1:A5");

  // Create icon set conditional formatting on the range.
  const conditionalFormatting = range.addConditionalFormat(ExcelScript.ConditionalFormatType.iconSet);

  // Use the "3 Traffic Lights (Unrimmed)" set.
  conditionalFormatting.getIconSet().setStyle(ExcelScript.IconSet.threeTrafficLights1);

  // Set the criteria to use a different icon for the bottom, middle, and top thirds of the values in the range.
  const criteria: ExcelScript.ConditionalIconCriterion[] = [
    {
      formula: '=0', operator: ExcelScript.ConditionalIconCriterionOperator.greaterThanOrEqual,
      type: ExcelScript.ConditionalFormatIconRuleType.percent
    },
    {
      formula: '=33', operator: ExcelScript.ConditionalIconCriterionOperator.greaterThanOrEqual,
      type: ExcelScript.ConditionalFormatIconRuleType.percent
    },
    {
      formula: '=67', operator: ExcelScript.ConditionalIconCriterionOperator.greaterThanOrEqual,
      type: ExcelScript.ConditionalFormatIconRuleType.percent
    }];
  conditionalFormatting.getIconSet().setCriteria(criteria);
}

Eigenschaften

customIcon

Das benutzerdefinierte Symbol für das aktuelle Kriterium, wenn es sich von dem Standardsymbolsatz unterscheidet, wird andernfalls null zurückgegeben.

formula

Eine Zahl oder eine Formel, je nach Typ.

operator

greaterThan oder greaterThanOrEqual für jeden Regeltyp für das bedingte Symbolformat.

type

Die Basis für die bedingte Symbolformel.

Details zur Eigenschaft

customIcon

Das benutzerdefinierte Symbol für das aktuelle Kriterium, wenn es sich von dem Standardsymbolsatz unterscheidet, wird andernfalls null zurückgegeben.

customIcon?: Icon;

Eigenschaftswert

formula

Eine Zahl oder eine Formel, je nach Typ.

formula: string;

Eigenschaftswert

string

operator

greaterThan oder greaterThanOrEqual für jeden Regeltyp für das bedingte Symbolformat.

operator: ConditionalIconCriterionOperator;

Eigenschaftswert

type

Die Basis für die bedingte Symbolformel.

type: ConditionalFormatIconRuleType;

Eigenschaftswert