ExcelScript.TopBottomConditionalFormat interface
Représente un format conditionnel haut/bas.
Remarques
Exemples
/**
* This sample applies conditional formatting to the currently used range in the worksheet.
* The conditional formatting is a green fill for the top 10% of 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 green for the top 10% of values in the range.
let conditionalFormat = range.addConditionalFormat(ExcelScript.ConditionalFormatType.topBottom)
conditionalFormat.getTopBottom().getFormat().getFill().setColor("green");
conditionalFormat.getTopBottom().setRule({
rank: 10, /* The percentage threshold. */
type: ExcelScript.ConditionalTopBottomCriterionType.topPercent /* The type of the top/bottom condition. */
});
}
Méthode
| get |
Renvoie un objet format, encapsulant la police, le remplissage, les bordures et d’autres propriétés du format conditionnel. |
| get |
Critères du format conditionnel supérieur/inférieur. |
| set |
Critères du format conditionnel supérieur/inférieur. |
Détails de la méthode
getFormat()
Renvoie un objet format, encapsulant la police, le remplissage, les bordures et d’autres propriétés du format conditionnel.
getFormat(): ConditionalRangeFormat;
Retourne
getRule()
Critères du format conditionnel supérieur/inférieur.
getRule(): ConditionalTopBottomRule;
Retourne
setRule(rule)
Critères du format conditionnel supérieur/inférieur.
setRule(rule: ConditionalTopBottomRule): void;
Paramètres
Retourne
void