Compartir a través de


ExcelScript.ConditionalTopBottomRule interface

Representa la regla del formato condicional superior o inferior.

Comentarios

Ejemplos

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

Propiedades

rank

El rango entre 1 y 1000 para los rangos numéricos o entre 1 y 100 para los rangos porcentuales.

type

Dar formato a los valores en función de la clasificación superior o inferior.

Detalles de las propiedades

rank

El rango entre 1 y 1000 para los rangos numéricos o entre 1 y 100 para los rangos porcentuales.

rank: number;

Valor de propiedad

number

type

Dar formato a los valores en función de la clasificación superior o inferior.

type: ConditionalTopBottomCriterionType;

Valor de propiedad