Tài liệu HotXLS

Phương thức AddCondFormatColorScale2

Thêm quy tắc định dạng có điều kiện Color Scale 2 điểm dừng theo Excel 2007+ lên một vùng ô, trả về đối tượng TCondFormatRule mới để có thể tinh chỉnh ghi đè DXF Style của quy tắc trước khi lưu. Các ô nhận tô chuyển sắc nội suy giữa AMinColor (tại ngưỡng min) và AMaxColor (tại ngưỡng max). (Có từ v2.34.0.)

Cú pháp

function AddCondFormatColorScale2(const ARange: WideString;
  AMinColor, AMaxColor: LongWord;
  AMinKind: TXLSCfValueKind = cfvMinOfRange; const AMinValue: WideString = '';
  AMaxKind: TXLSCfValueKind = cfvMaxOfRange; const AMaxValue: WideString = ''): TCondFormatRule;
ARange WideString. Sqref String, e.g. 'A1:A10'
AMinColor / AMaxColor LongWord. Gradient endpoint colors in Delphi BGR định dạng (R in the low byte)
AMinKind / AMaxKind TXLSCfValueKind. Threshold types — see TXLSCfValueKind
AMinValue / AMaxValue WideString. Threshold literal; ignored for kinds that auto-detect

Ví dụ

Ví dụ này tô màu A1:A10 từ trắng đến xanh lá dựa trên giá trị min và max của vùng

Sheet.AddCondFormatColorScale2('A1:A10', $00FFFFFF, $0000FF00);

Xem thêm