Freigeben über


ExcelScript.ConditionalTopBottomRule interface

Stellt die Regel des oberen/unteren bedingten Formats dar.

Hinweise

Beispiele

/**
 * This sample applies conditional formatting to the currently used range in the worksheet. 
 * The conditional formatting is a pink fill for the 5 lowest values.
 */
function main(workbook: ExcelScript.Workbook) {
  // Get the current worksheet.
  let selectedSheet = workbook.getActiveWorksheet();

  // Get the used range in the worksheet.
  let range = selectedSheet.getUsedRange();

  // Set the fill color to pink for the lowest 5 values in the range.
  let conditionalFormat = range.addConditionalFormat(ExcelScript.ConditionalFormatType.topBottom)
  conditionalFormat.getTopBottom().getFormat().getFill().setColor("pink");
  conditionalFormat.getTopBottom().setRule({
    rank: 5, /* The numerical threshold. */
    type: ExcelScript.ConditionalTopBottomCriterionType.bottomItems /* The type of the top/bottom condition. */
  });
}

Eigenschaften

rank

Der Rang zwischen 1 und 1000 für numerische Ränge oder 1 und 100 als Prozentränge.

type

Formatieren Sie Werte basierend auf dem oberen oder unteren Rang.

Details zur Eigenschaft

rank

Der Rang zwischen 1 und 1000 für numerische Ränge oder 1 und 100 als Prozentränge.

rank: number;

Eigenschaftswert

number

type

Formatieren Sie Werte basierend auf dem oberen oder unteren Rang.

type: ConditionalTopBottomCriterionType;

Eigenschaftswert