Macrocommando AddFormatCondition

<< Click to Display Table of Contents >>

Navigation:  Macros > Macro commands and parameters > Macro reporting commands > Macro write to Excel >

Macrocommando AddFormatCondition

Purpose:

Set conditional formatting of some cells of a worksheet of a workbook with FileIndex. Only FileIndex 0 is supported.

 

General notation:

AddFormatCondition ( FileIndex , sheet , row1 , column1 , row2 , column2 , ConditionType, Operator, Formula, FontColour, CellColour )

 

The range of cells can be accessed through the row and column numbers. The values row1 and column1 indicate the top-left corner of the array and row2 and column2 the bottom-right corner.

 

ConditionType is an integer with the following meaning:

1        Cell value

2        Expression

3        Colour scale

4        Databar

5        Top 10 values

6        Icon set

8        Unique values

9        Text string

10        Blanks condition

11        Time period

12        Above average condition

13        No blanks condition

16        Errors condition

17        No errors condition

 

Operator is an integer with the following meaning:

1        between

2        not between

3        equal

4        not equal

5        greater than

6        less than

7        greater than or equal to

8        less than or equal to

 

The value FontColour and CellColour is an integer value is between 0 and 14, corresponding to the colours:

0        no special colour

1        grey

2        light grey

3        navy blue

4        blue

5        aquamarine

6        purple

7        pink

8        green

9        light green

10        blue-green

11        red-brown

12        red

13        yellow

14        white

 

 

Example:

 

AddFormatCondition(0,1,1,1,20,20,1,5,'100',0,12)