HotXLS 文档

AddCondFormatIconSet 方法

Adds an Excel 2007+ Icon Set conditional formatting rule over a cell range, returning the new TCondFormatRule。每个单元格按其值落在自动计算的百分位阈值中的位置,获得所选图标族中 3、4 或 5 个图标之一。(v2.34.0 起可用)

语法

function AddCondFormatIconSet(const ARange: WideString;
  ASetType: TXLSIconSetType): TCondFormatRule;
ARange WideString. Sqref string, e.g. 'A1:A10'
ASetType TXLSIconSetType。Excel 2007 的 17 个基准图标族之一 — icsArrows3 / icsArrows3Gray / icsFlags3 / icsTrafficLights3 / icsTrafficLightsRimmed3 / icsSigns3 / icsSymbols3 / icsSymbolsUncircled3 / icsArrows4 / icsArrows4Gray / icsRedToBlack4 / icsRatings4 / icsTrafficLights4 / icsArrows5 / icsArrows5Gray / icsRatings5 / icsQuarters5。参见 TXLSIconSetType

备注

默认阈值把取值范围切成相等的百分位区段(3 个图标 → 0/33/67,4 个图标 → 0/25/50/75,5 个图标 → 0/20/40/60/80)。使用返回的 TCondFormatRule.IconSet to override individual thresholds via SetThreshold, or to set Reverse / ShowOnly

示例

This example puts the "3 Arrows (Colored)" icon set over A1:A10

Sheet.AddCondFormatIconSet('A1:A10', icsArrows3);

请参阅