HotXLS-dokumentation

AddCondFormatColorScale3 metode

Tilføjer en Excel 2007+ 3-stop Farveskala-betinget formateringsregel over et celleområde og returnerer den nye TCondFormatRule. Celler modtager en gradueret udfyldning, der interpolerer mellem tre farvesæt: min, midt (standard på 50. percentil) og max. (Tilgængelig siden v2.34.0.)

Syntaks

function AddCondFormatColorScale3(const ARange: WideString;
  AMinColor, AMidColor, AMaxColor: LongWord;
  AMinKind: TXLSCfValueKind = cfvMinOfRange; const AMinValue: WideString = '';
  AMidKind: TXLSCfValueKind = cfvPercentile; const AMidValue: WideString = '50';
  AMaxKind: TXLSCfValueKind = cfvMaxOfRange; const AMaxValue: WideString = ''): TCondFormatRule;
ARange WideString. Sqref String, e.g. 'A1:A10'
AMinColor / AMidColor / AMaxColor LongWord. Three gradient anchor colors in Delphi BGR format
AMinKind / AMidKind / AMaxKind TXLSCfValueKind. Threshold types. Mid defaults to cfvPercentile / '50' — the classic "Red–Yellow–Green" Excel preset
AMinValue / AMidValue / AMaxValue WideString. Threshold literal text. AMidValue defaults to '50' to pair with cfvPercentile

Eksempel

Dette eksempel farver A1:A10 med den klassiske Rød-Gul-Grøn skala

Sheet.AddCondFormatColorScale3('A1:A10',
  $000000FF, $0000FFFF, $0000FF00);

Se også