ExcelScript.ConditionalFormatPresetCriterion enum
Stellt die Kriterien des bedingten Formattyps für voreingestellte Kriterien dar.
Hinweise
Beispiele
/**
* This script applies a conditional format that uses a preset criterion.
* Any cell in row 1 will have the color fill set to green if it is a duplicate value
* (of anything else in row 1).
*/
function main(workbook: ExcelScript.Workbook) {
// Get the range for row 1.
const sheet = workbook.getActiveWorksheet();
const formattedRange = sheet.getRange("1:1");
// Add new conditional formatting to that range.
const conditionalFormat = formattedRange.addConditionalFormat(
ExcelScript.ConditionalFormatType.presetCriteria);
// Set the conditional formatting to apply a green fill.
const presetFormat = conditionalFormat.getPreset();
presetFormat.getFormat().getFill().setColor("green");
// Set a rule to apply the conditional format when values are duplicated in the range.
const duplicateRule: ExcelScript.ConditionalPresetCriteriaRule = {
criterion: ExcelScript.ConditionalFormatPresetCriterion.duplicateValues
};
presetFormat.setRule(duplicateRule);
}
Felder
aboveAverage | |
belowAverage | |
blanks | |
duplicateValues | |
equalOrAboveAverage | |
equalOrBelowAverage | |
errors | |
invalid | |
lastMonth | |
lastSevenDays | |
lastWeek | |
nextMonth | |
nextWeek | |
nonBlanks | |
nonErrors | |
oneStdDevAboveAverage | |
oneStdDevBelowAverage | |
thisMonth | |
thisWeek | |
threeStdDevAboveAverage | |
threeStdDevBelowAverage | |
today | |
tomorrow | |
twoStdDevAboveAverage | |
twoStdDevBelowAverage | |
uniqueValues | |
yesterday |
Zusammenarbeit auf GitHub
Die Quelle für diesen Inhalt finden Sie auf GitHub, wo Sie auch Issues und Pull Requests erstellen und überprüfen können. Weitere Informationen finden Sie in unserem Leitfaden für Mitwirkende.
Office Scripts