<κλάση header="doc-nav" aria-label="Πλοήγηση τεκμηρίωσης"> Τεκμηρίωση HotXLS <κλάση nav="doc-links"> Περιεχόμενα Αρχική Επισκόπηση TGridToXLS IXLSWorkbook <κλάση div="nav topic-quick-nav" aria-label="Topic shortcuts"> Αρχική Περιεχόμενα Επισκόπηση

ApplyAutoFilter μέθοδος

<κλάση div="indent"> <κλάση div="txt"> Sets a classic XLS AutoFilter range and applies a per-field criterion in one call

Σύνταξη

<κλάση div="indent"> <κλάση div="txt"> procedure ApplyAutoFilter(ARange: WideString; Field: Integer; Criteria1: Variant); overload; <κλάση div="txt"> procedure ApplyAutoFilter(ARange: WideString; Field: Integer; Criteria1: Variant; Operator: XlAutoFilterOperator; Criteria2: Variant); overload; <κλάση div="txt"> procedure ApplyAutoFilter(ARow1, ACol1, ARow2, ACol2: Integer; Field: Integer; Criteria1: Variant); overload; <κλάση div="txt"> procedure ApplyAutoFilter(ARow1, ACol1, ARow2, ACol2: Integer; Field: Integer; Criteria1: Variant; Operator: XlAutoFilterOperator; Criteria2: Variant); overload;

Παρατηρήσεις

<κλάση div="indent"> <κλάση div="txt"> The string overload accepts an A1-style range such as A1:C5. The numeric overload uses 1-based row and column indexes. Field is also 1-based within the AutoFilter range <κλάση div="txt"> ApplyAutoFilter replaces any existing worksheet-level AutoFilter range with the supplied range, then writes the same BIFF8 field criteria records used by IXLSRange.Autofilter <κλάση div="txt"> Use TXLSWorksheet.AutoFilterColumns.Find(Field) to inspect the stored per-field criteria after applying or reading a classic XLS AutoFilter

Παράδειγμα

<κλάση pre="code"> Workbook := TXLSWorkbook.Create; try Sheet := Workbook.Sheets[1]; Sheet.ApplyAutoFilter('A1:C5', 2, '>=100'); Workbook.SaveAs('filtered.xls', xlExcel97); finally Workbook.Free; end;

See Also

<κλάση div="indent"> <κλάση div="txt"> TXLSWorksheet.SetAutoFilterμέθοδος
TXLSWorksheet.AutoFilterColumnsιδιότητα
TXLSWorksheet.AutoFilterRangeιδιότητα
TXLSWorksheet.ClearAutoFilterμέθοδος
IXLSRange.Autofilterμέθοδος
κλάση TXLSWorksheet <κλάση footer="reference-footer">Copyright © 2010-2026 losLab Software