SetFill

Set the fill colors and patterns of cells.

Overloads

Overload Name Description
Clear Clears the fill color and pattern.
General Set cell fill properties.
Gradient (7.3) Set cell fill as gradient.
GradientLinear (7.3) Set cell fill as gradient/linear with up to 10 colors.
GradientRectangle (7.3) Set cell fill as gradient/recangle with up to 10 colors.


Clear

Clears the fill color and pattern.

Argument Description
SpecifySheetBy Select how to specify which worksheet to select while the method is being executed.
Specify one of the following values or an arbitrary value: <blank>SheetNameSheetNumberAllSheets
SheetSpec Specify the sheet-name or sheet-number, depending on SpecifySheetBy. If SpecifySheetBy is AllSheets then SheetSpec can be left empty.
Address The address of a range to select for the execution of the method.
CellByCell Whether to execute the method on a cell-by-cell basis, or on the range specified by the address.
ReverseOrder Whether to loop through the rows and columns from highest to lowest. Only applies when CellByCell is true.
MethodCondition If the result of method-condition expression resolves to FALSE, then the method is not executed.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
CellCondition If the result of the condition expression resolves to FALSE, then the current cell is skipped.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE

General

Set cell fill properties.

Argument Description
SpecifySheetBy Select how to specify which worksheet to select while the method is being executed.
Specify one of the following values or an arbitrary value: <blank>SheetNameSheetNumberAllSheets
SheetSpec Specify the sheet-name or sheet-number, depending on SpecifySheetBy. If SpecifySheetBy is AllSheets then SheetSpec can be left empty.
Address The address of a range to select for the execution of the method.
CellByCell Whether to execute the method on a cell-by-cell basis, or on the range specified by the address.
ReverseOrder Whether to loop through the rows and columns from highest to lowest. Only applies when CellByCell is true.
MethodCondition If the result of method-condition expression resolves to FALSE, then the method is not executed.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
CellCondition If the result of the condition expression resolves to FALSE, then the current cell is skipped.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
FillColorRGB (8.0) Select a color to use for the fill color. FillColorRGB is used if FillColor and FillColorRGB are both specified.
FillColor Excel color palette index to use for fill color. The value is zero-based from 0 to 55.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
PatternColorRGB (8.0) Select a color to use for the pattern color. PatternColorRGB is used if PatternColor and PatternColorRGB are both specified.
PatternColor Excel color palette index to use for pattern color. The value is zero-based from 0 to 55.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
Pattern Pattern to use for fill.
Specify one of the following values or an arbitrary value: <blank>AutomaticCheckerCrissCrossDownGray16Gray25Gray50Gray75Gray8GridHorizontalLightDownLightHorizontalLightUpLightVerticalNoneSemiGray75SolidUpVertical

Gradient (7.3)

Set cell fill as gradient.

Argument Description
SpecifySheetBy Select how to specify which worksheet to select while the method is being executed.
Specify one of the following values or an arbitrary value: <blank>SheetNameSheetNumberAllSheets
SheetSpec Specify the sheet-name or sheet-number, depending on SpecifySheetBy. If SpecifySheetBy is AllSheets then SheetSpec can be left empty.
Address The address of a range to select for the execution of the method.
CellByCell Whether to execute the method on a cell-by-cell basis, or on the range specified by the address.
ReverseOrder Whether to loop through the rows and columns from highest to lowest. Only applies when CellByCell is true.
MethodCondition If the result of method-condition expression resolves to FALSE, then the method is not executed.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
CellCondition If the result of the condition expression resolves to FALSE, then the current cell is skipped.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
Style Controls where gradient starts (with Color1) and the direction it fills from.
Specify one of the following values or an arbitrary value: <blank>FromTopToBottomFromBottomToTopFromTopAndBottomFromLeftToRightFromRightToLeftFromLeftAndRightFromUpperLeftFromLowerRightFromUpperLeftAndLowerRightFromUpperRightFromLowerLeftFromUpperRightAndLowerLeftRadiateFromUpperLeftRadiateFromUpperRightRadiateFromLowerLeftRadiateFromLowerRightRadiateFromCenter
Color1 The color for Color1.
Use Color1 or Color1Index. If both are specified then Color1 is used.
Color1Index Excel color palette index to use for Color1. The value is zero-based from 0 to 55.
Use Color1 or Color1Index. If both are specified then Color1 is used.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
Color2 The color for Color2.
Use Color2 or Color2Index. If both are specified then Color2 is used.
Color2Index Excel color palette index to use for Color2. The value is zero-based from 0 to 55.
Use Color2 or Color2Index. If both are specified then Color2 is used.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455

GradientLinear (7.3)

Set cell fill as gradient/linear with up to 10 colors.

Argument Description
SpecifySheetBy Select how to specify which worksheet to select while the method is being executed.
Specify one of the following values or an arbitrary value: <blank>SheetNameSheetNumberAllSheets
SheetSpec Specify the sheet-name or sheet-number, depending on SpecifySheetBy. If SpecifySheetBy is AllSheets then SheetSpec can be left empty.
Address The address of a range to select for the execution of the method.
CellByCell Whether to execute the method on a cell-by-cell basis, or on the range specified by the address.
ReverseOrder Whether to loop through the rows and columns from highest to lowest. Only applies when CellByCell is true.
MethodCondition If the result of method-condition expression resolves to FALSE, then the method is not executed.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
CellCondition If the result of the condition expression resolves to FALSE, then the current cell is skipped.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
DirectionLinear Controls where gradient starts (with Color1) and the direction it fills from.
If Angle is also specified, Angle will override the value of DirectionLinear.
Specify one of the following values or an arbitrary value: FromTopToBottomFromBottomToTopFromLeftToRightFromRightToLeftFromLowerLeftFromLowerRightFromUpperLeftFromUpperRight
Angle Controls where gradient starts (with Color1) and the direction it fills from.
If DirectionLinear is also specified, Angle will override the value of DirectionLinear.
Color1 The color for Color1.
Use Color1 or Color1Index. If both are specified then Color1 is used.
Color1Index Excel color palette index to use for Color1. The value is zero-based from 0 to 55.
Use Color1 or Color1Index. If both are specified then Color1 is used.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
Color1Position The point within the cell that the color is going to start at, (0-100).
The cell is divided into 100 points in whatever direction the gradient is being applied in.
Color1Position should be less than Color2Position; Color2Position should be less than Color3Position; etc.
If left blank, the position will be automatically calculated for even distribution.
Color2 The color for Color2.
Use Color2 or Color2Index. If both are specified then Color2 is used.
Color2Index Excel color palette index to use for Color2. The value is zero-based from 0 to 55.
Use Color2 or Color2Index. If both are specified then Color2 is used.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
Color2Position The point within the cell that the color is going to start at, (0-100).
The cell is divided into 100 points in whatever direction the gradient is being applied in.
Color1Position should be less than Color2Position; Color2Position should be less than Color3Position; etc.
If left blank, the position will be automatically calculated for even distribution.
Color3 The color for Color3.
Use Color3 or Color3Index. If both are specified then Color3 is used.
Color3Index Excel color palette index to use for Color3. The value is zero-based from 0 to 55.
Use Color3 or Color3Index. If both are specified then Color3 is used.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
Color3Position The point within the cell that the color is going to start at, (0-100).
The cell is divided into 100 points in whatever direction the gradient is being applied in.
Color1Position should be less than Color2Position; Color2Position should be less than Color3Position; etc.
If left blank, the position will be automatically calculated for even distribution.
Color4 The color for Color4.
Use Color4 or Color4Index. If both are specified then Color4 is used.
Color4Index Excel color palette index to use for Color4. The value is zero-based from 0 to 55.
Use Color4 or Color4Index. If both are specified then Color4 is used.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
Color4Position The point within the cell that the color is going to start at, (0-100).
The cell is divided into 100 points in whatever direction the gradient is being applied in.
Color1Position should be less than Color2Position; Color2Position should be less than Color3Position; etc.
If left blank, the position will be automatically calculated for even distribution.
Color5 The color for Color5.
Use Color5 or Color5Index. If both are specified then Color5 is used.
Color5Index Excel color palette index to use for Color5. The value is zero-based from 0 to 55.
Use Color5 or Color5Index. If both are specified then Color5 is used.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
Color5Position The point within the cell that the color is going to start at, (0-100).
The cell is divided into 100 points in whatever direction the gradient is being applied in.
Color1Position should be less than Color2Position; Color2Position should be less than Color3Position; etc.
If left blank, the position will be automatically calculated for even distribution.
Color6 The color for Color6.
Use Color6 or Color6Index. If both are specified then Color6 is used.
Color6Index Excel color palette index to use for Color6. The value is zero-based from 0 to 55.
Use Color6 or Color6Index. If both are specified then Color6 is used.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
Color6Position The point within the cell that the color is going to start at, (0-100).
The cell is divided into 100 points in whatever direction the gradient is being applied in.
Color1Position should be less than Color2Position; Color2Position should be less than Color3Position; etc.
If left blank, the position will be automatically calculated for even distribution.
Color7 The color for Color7.
Use Color7 or Color7Index. If both are specified then Color7 is used.
Color7Index Excel color palette index to use for Color7. The value is zero-based from 0 to 55.
Use Color7 or Color7Index. If both are specified then Color7 is used.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
Color7Position The point within the cell that the color is going to start at, (0-100).
The cell is divided into 100 points in whatever direction the gradient is being applied in.
Color1Position should be less than Color2Position; Color2Position should be less than Color3Position; etc.
If left blank, the position will be automatically calculated for even distribution.
Color8 The color for Color8.
Use Color8 or Color8Index. If both are specified then Color8 is used.
Color8Index Excel color palette index to use for Color8. The value is zero-based from 0 to 55.
Use Color8 or Color8Index. If both are specified then Color8 is used.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
Color8Position The point within the cell that the color is going to start at, (0-100).
The cell is divided into 100 points in whatever direction the gradient is being applied in.
Color1Position should be less than Color2Position; Color2Position should be less than Color3Position; etc.
If left blank, the position will be automatically calculated for even distribution.
Color9 The color for Color9.
Use Color9 or Color9Index. If both are specified then Color9 is used.
Color9Index Excel color palette index to use for Color9. The value is zero-based from 0 to 55.
Use Color9 or Color9Index. If both are specified then Color9 is used.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
Color9Position The point within the cell that the color is going to start at, (0-100).
The cell is divided into 100 points in whatever direction the gradient is being applied in.
Color1Position should be less than Color2Position; Color2Position should be less than Color3Position; etc.
If left blank, the position will be automatically calculated for even distribution.
Color10 The color for Color10.
Use Color10 or Color10Index. If both are specified then Color10 is used.
Color10Index Excel color palette index to use for position 10. The value is zero-based from 0 to 55.
Use Color10 or Color10Index. If both are specified then Color10 is used.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
Color10Position The point within the cell that the color is going to start at, (0-100).
The cell is divided into 100 points in whatever direction the gradient is being applied in.
Color1Position should be less than Color2Position; Color2Position should be less than Color3Position; etc.
If left blank, the position will be automatically calculated for even distribution.

GradientRectangle (7.3)

Set cell fill as gradient/recangle with up to 10 colors.

Argument Description
SpecifySheetBy Select how to specify which worksheet to select while the method is being executed.
Specify one of the following values or an arbitrary value: <blank>SheetNameSheetNumberAllSheets
SheetSpec Specify the sheet-name or sheet-number, depending on SpecifySheetBy. If SpecifySheetBy is AllSheets then SheetSpec can be left empty.
Address The address of a range to select for the execution of the method.
CellByCell Whether to execute the method on a cell-by-cell basis, or on the range specified by the address.
ReverseOrder Whether to loop through the rows and columns from highest to lowest. Only applies when CellByCell is true.
MethodCondition If the result of method-condition expression resolves to FALSE, then the method is not executed.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
CellCondition If the result of the condition expression resolves to FALSE, then the current cell is skipped.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
DirectionRectangle Controls where gradient starts (with Color1) and the direction it fills from.
Specify one of the following values or an arbitrary value: FromLowerLeftFromLowerRightFromCenterFromUpperLeftFromUpperRight
Color1 The color for Color1.
Use Color1 or Color1Index. If both are specified then Color1 is used.
Color1Index Excel color palette index to use for Color1. The value is zero-based from 0 to 55.
Use Color1 or Color1Index. If both are specified then Color1 is used.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
Color1Position The point within the cell that the color is going to start at, (0-100).
The cell is divided into 100 points in whatever direction the gradient is being applied in.
Color1Position should be less than Color2Position; Color2Position should be less than Color3Position; etc.
If left blank, the position will be automatically calculated for even distribution.
Color2 The color for Color2.
Use Color2 or Color2Index. If both are specified then Color2 is used.
Color2Index Excel color palette index to use for Color2. The value is zero-based from 0 to 55.
Use Color2 or Color2Index. If both are specified then Color2 is used.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
Color2Position The point within the cell that the color is going to start at, (0-100).
The cell is divided into 100 points in whatever direction the gradient is being applied in.
Color1Position should be less than Color2Position; Color2Position should be less than Color3Position; etc.
If left blank, the position will be automatically calculated for even distribution.
Color3 The color for Color3.
Use Color3 or Color3Index. If both are specified then Color3 is used.
Color3Index Excel color palette index to use for Color3. The value is zero-based from 0 to 55.
Use Color3 or Color3Index. If both are specified then Color3 is used.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
Color3Position The point within the cell that the color is going to start at, (0-100).
The cell is divided into 100 points in whatever direction the gradient is being applied in.
Color1Position should be less than Color2Position; Color2Position should be less than Color3Position; etc.
If left blank, the position will be automatically calculated for even distribution.
Color4 The color for Color4.
Use Color4 or Color4Index. If both are specified then Color4 is used.
Color4Index Excel color palette index to use for Color4. The value is zero-based from 0 to 55.
Use Color4 or Color4Index. If both are specified then Color4 is used.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
Color4Position The point within the cell that the color is going to start at, (0-100).
The cell is divided into 100 points in whatever direction the gradient is being applied in.
Color1Position should be less than Color2Position; Color2Position should be less than Color3Position; etc.
If left blank, the position will be automatically calculated for even distribution.
Color5 The color for Color5.
Use Color5 or Color5Index. If both are specified then Color5 is used.
Color5Index Excel color palette index to use for Color5. The value is zero-based from 0 to 55.
Use Color5 or Color5Index. If both are specified then Color5 is used.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
Color5Position The point within the cell that the color is going to start at, (0-100).
The cell is divided into 100 points in whatever direction the gradient is being applied in.
Color1Position should be less than Color2Position; Color2Position should be less than Color3Position; etc.
If left blank, the position will be automatically calculated for even distribution.
Color6 The color for Color6.
Use Color6 or Color6Index. If both are specified then Color6 is used.
Color6Index Excel color palette index to use for Color6. The value is zero-based from 0 to 55.
Use Color6 or Color6Index. If both are specified then Color6 is used.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
Color6Position The point within the cell that the color is going to start at, (0-100).
The cell is divided into 100 points in whatever direction the gradient is being applied in.
Color1Position should be less than Color2Position; Color2Position should be less than Color3Position; etc.
If left blank, the position will be automatically calculated for even distribution.
Color7 The color for Color7.
Use Color7 or Color7Index. If both are specified then Color7 is used.
Color7Index Excel color palette index to use for Color7. The value is zero-based from 0 to 55.
Use Color7 or Color7Index. If both are specified then Color7 is used.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
Color7Position The point within the cell that the color is going to start at, (0-100).
The cell is divided into 100 points in whatever direction the gradient is being applied in.
Color1Position should be less than Color2Position; Color2Position should be less than Color3Position; etc.
If left blank, the position will be automatically calculated for even distribution.
Color8 The color for Color8.
Use Color8 or Color8Index. If both are specified then Color8 is used.
Color8Index Excel color palette index to use for Color8. The value is zero-based from 0 to 55.
Use Color8 or Color8Index. If both are specified then Color8 is used.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
Color8Position The point within the cell that the color is going to start at, (0-100).
The cell is divided into 100 points in whatever direction the gradient is being applied in.
Color1Position should be less than Color2Position; Color2Position should be less than Color3Position; etc.
If left blank, the position will be automatically calculated for even distribution.
Color9 The color for Color9.
Use Color9 or Color9Index. If both are specified then Color9 is used.
Color9Index Excel color palette index to use for Color9. The value is zero-based from 0 to 55.
Use Color9 or Color9Index. If both are specified then Color9 is used.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
Color9Position The point within the cell that the color is going to start at, (0-100).
The cell is divided into 100 points in whatever direction the gradient is being applied in.
Color1Position should be less than Color2Position; Color2Position should be less than Color3Position; etc.
If left blank, the position will be automatically calculated for even distribution.
Color10 The color for Color10.
Use Color10 or Color10Index. If both are specified then Color10 is used.
Color10Index Excel color palette index to use for position 10. The value is zero-based from 0 to 55.
Use Color10 or Color10Index. If both are specified then Color10 is used.
Specify one of the following values or an arbitrary value: <blank>012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
Color10Position The point within the cell that the color is going to start at, (0-100).
The cell is divided into 100 points in whatever direction the gradient is being applied in.
Color1Position should be less than Color2Position; Color2Position should be less than Color3Position; etc.
If left blank, the position will be automatically calculated for even distribution.