AUTOFILTER: AutoFilter Data (9Eh)

This record stores data for an active AutoFilter.

Record Data — BIFF7 and Later

Offset

Name

Size

Contents

4

iEntry

2

Index of the active AutoFilter

6

grbit

2

Option flags

8

doper1

10

DOPER structure for the first filter condition (see text)

18

doper2

10

DOPER structure for the second filter condition (see text)

28

rgch

var

String storage for vtString DOPER (see text)


The grbit field contains the option flags listed in the following table.

Offset

Bits

Mask

Name

Contents

0

1 – 0

0003h

wJoin

= 1 if the custom filter conditions are ANDed
= 0 if the custom filter conditions are ORed

2

0004h

fSimple1

= 1 if the first condition is a simple equality (for optimization)

3

0008h

fSimple2

= 1 if the second condition is a simple equality (for optimization)

4

0010h

fTop10

= 1 if the condition is a Top 10 AutoFilter

5

0020h

fTop

= 1 if the Top 10 AutoFilter shows the top items; = 0 if it shows the bottom items

6

0040h

fPercent

= 1 if the Top 10 AutoFilter shows percentage; = 0 if it shows items

15 – 7

FF80h

wTop10

The number of items to show (from 1 to 500 decimal, expressed as a binary number)


Record Data — BIFF5

Offset

Name

Size

Contents

4

iEntry

2

Index of the active AutoFilter

6

grbit

2

Option flags

8

doper1

10

DOPER structure for first filter condition (see text)

18

doper2

10

DOPER structure for the second filter condition (see text)

28

rgch

var

String storage for vtString DOPER (see text)


The grbit field contains the option flags listed in the following table.

Offset

Bits

Mask

Name

Contents

0

1 – 0

03h

wJoin

= 1 if the custom filter conditions are ANDed
= 0 if the custom filter conditions are ORed

2

04h

fSimple1

= 1 if the first condition is a simple equality (for optimization)

3

08h

fSimple2

= 1 if the second condition is a simple equality (for optimization)

7 – 4

F0h

(Reserved)

1

7 – 0

FFh

(Reserved)


DOPER Structures

The database oper structures (DOPERs) are 10-byte parsed definitions of the filter conditions that appear in the Custom AutoFilter dialog box. The DOPER structures are defined in the following sections.

DOPER Structure for RK Numbers (vt = 02h)

Offset

Name

Size

Contents

0

vt

1

Data type (see text)

1

grbitSgn

1

Comparison code (see text)

2

rk

4

RK number (see "RK" on page 376)

6

(reserved)

4


DOPER Structure for IEEE Floating-Point Numbers (vt = 04h)

Offset

Name

Size

Contents

0

vt

1

Data type (see text)

1

grbitSgn

1

Comparison code (see text)

2

num

8

IEEE floating-point number


DOPER Structure for Strings (vt = 06h)

Offset

Name

Size

Contents

0

vt

1

Data type (see text)

1

grbitSgn

1

Comparison code (see text)

2

(reserved)

4

6

cch

1

Length of the string (the string is stored in rgch field that follows the DOPER structures)

7

(reserved)

3


DOPER Structure for Boolean and Error Values (vt = 08h)

Offset

Name

Size

Contents

0

vt

1

Data type (see text)

1

grbitSgn

1

Comparison code (see text)

2

fError

1

Boolean/error flag

3

bBoolErr

1

Boolean value or error value

4

(reserved)

6


The bBoolErr field contains the Boolean or error value, as determined by the fError field. If the fError field contains a 0 (zero), the bBoolErr field contains a Boolean value; if the fError field contains a 1, the bBoolErr field contains an error value.

Boolean values are 1 for true and 0 for false.

Error values are listed in the following table.

Error value

Value (hex)

Value (dec.)

#NULL!

00h

0

#DIV/0!

07h

7

#VALUE!

0Fh

15

#REF!

17h

23

#NAME?

1Dh

29

#NUM!

24h

36

#N/A

2Ah

42


The vt field contains the data type of the DOPER, as shown in the following table. For the DOPER types 00h, 0Ch, and 0Eh, the remaining 9 bytes of the DOPER are ignored.

vt

DOPER type

00h

Filter condition not used

02h

RK number

04h

IEEE number

06h

String

08h

Boolean or error value

0Ch

Match all blanks

0Eh

Match all non-blanks


The grbitSgn field corresponds to comparison operators, as shown in the following table.

grbitSgn

Operator

01

<

02

=

03

<=

04

>

05

<>

06

>=