次の方法で共有


ExcelScript.ConditionalTopBottomRule interface

上下の条件付き書式のルールを表します。

注釈

/**
 * 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. */
  });
}

プロパティ

rank

数値のランクに対する 1 から 1000、またはパーセントのランクに対する 1 から 100 のランク。

type

上位または下位のランクに基づいて値を書式設定します。

プロパティの詳細

rank

数値のランクに対する 1 から 1000、またはパーセントのランクに対する 1 から 100 のランク。

rank: number;

プロパティ値

number

type

上位または下位のランクに基づいて値を書式設定します。

type: ConditionalTopBottomCriterionType;

プロパティ値