ExcelScript.ConditionalTopBottomRule interface

Representa a regra do formato condicional superior/inferior.

Comentários

Exemplos

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

Propriedades

rank

A classificação entre 1 e 1000 para classificações numéricas ou 1 e 100 para classificações percentuais.

type

Formatar valores com base na classificação superior ou inferior.

Detalhes da propriedade

rank

A classificação entre 1 e 1000 para classificações numéricas ou 1 e 100 para classificações percentuais.

rank: number;

Valor da propriedade

number

type

Formatar valores com base na classificação superior ou inferior.

type: ConditionalTopBottomCriterionType;

Valor da propriedade