ExcelScript.TopBottomConditionalFormat interface
Stellt ein bedingtes Format oben/unten dar.
Hinweise
Beispiele
/**
* 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. */
});
}
Methoden
get |
Gibt ein Formatobjekt zurück, das die Schriftart, die Füllung, die Rahmen und andere Eigenschaften des bedingten Formats kapselt. |
get |
Die Kriterien des bedingten Formats oben/unten. |
set |
Die Kriterien des bedingten Formats oben/unten. |
Details zur Methode
getFormat()
Gibt ein Formatobjekt zurück, das die Schriftart, die Füllung, die Rahmen und andere Eigenschaften des bedingten Formats kapselt.
getFormat(): ConditionalRangeFormat;
Gibt zurück
getRule()
Die Kriterien des bedingten Formats oben/unten.
getRule(): ConditionalTopBottomRule;
Gibt zurück
setRule(rule)
Die Kriterien des bedingten Formats oben/unten.
setRule(rule: ConditionalTopBottomRule): void;
Parameter
Gibt zurück
void
Office Scripts
Feedback
https://aka.ms/ContentUserFeedback.
Bald verfügbar: Im Laufe des Jahres 2024 werden wir GitHub-Issues stufenweise als Feedbackmechanismus für Inhalte abbauen und durch ein neues Feedbacksystem ersetzen. Weitere Informationen finden Sie unterFeedback senden und anzeigen für