Set-SLConditionalFormatColorScale


Synopsis

Apply conditional formatting color scale to a range.

Syntax

Description

Apply conditional formatting color scale to a range.
Cells are shaded with gradations of two or three colors that correspond to minimum, midpoint, and maximum thresholds.

Parameters

-WorkBookInstance

Instance of an excel document that can be used for editing.

Required? True
Position? 0
Default value  
Accept pipeline input? true (ByValue)
Accept wildcard characters? False

-WorksheetName

This is the name of the worksheet that contains the cell range where formatting is to be applied.

Required? True
Position? 1
Default value  
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? False

-Range

The range of cells where conditional formatting has to be applied.

Required? True
Position? 2
Default value  
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? False

-ColorScaleType

Built-in color scale styles.
Use tab or intellisense to select from a range of possible values.
Possible values are:
&;39;GreenYellowRed&;39;,&;39;RedYellowGreen&;39;,&;39;BlueYellowRed&;39;,&;39;RedYellowBlue&;39;,&;39;GreenWhiteRed&;39;,&;39;RedWhiteGreen&;39;,&;39;BlueWhiteRed&;39;,&;39;RedWhiteBlue&;39;,&;39;WhiteRed&;39;,&;39;RedWhite&;39;,&;39;GreenWhite&;39;,&;39;WhiteGreen&;39;,&;39;Yellow&;39;,
&;39;Red&;39;,&;39;RedYellow&;39;,&;39;GreenYellow&;39;,&;39;YellowGreen&;39;

Required? True
Position? 3
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-ColorScaleMinType

to be used with a custom color scale formatting style.
Use tab or intellisense to select from a range of possible values.
Possible values are:
&;39;Value&;39;,&;39;Number&;39;,&;39;Percent&;39;,&;39;Formula&;39;,&;39;Percentile&;39;

Required? True
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-MinValue

the minimum value in the range.

Required? True
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-ColorScaleMinSystemColor

Custom color for the minimum values.

Required? True
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-ColorScaleMaxType

to be used with a custom color scale formatting style.
Use tab or intellisense to select from a range of possible values.
Possible values are:
&;39;Value&;39;,&;39;Number&;39;,&;39;Percent&;39;,&;39;Formula&;39;,&;39;Percentile&;39;

Required? True
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-MaxValue

The maximum value in the range.

Required? True
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-ColorScaleMaxSystemColor

Custom color for the maximum values.

Required? True
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-ColorScale2

to be used with a custom 2colorscale formatting style.

Required? False
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-ColorScale3

to be used with a custom 3colorscale formatting style.

Required? False
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-MidPointType

to be used with a custom 3color scale formatting style.
Use tab or intellisense to select from a range of possible values.
Possible values are:
&;39;Number&;39;,&;39;Percent&;39;,&;39;Formula&;39;,&;39;Percentile&;39;

Required? True
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-MidPointValue

The mid value in the range.

Required? True
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-MidPointColor

Custom color for the mid values.

Required? True
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? False

This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

Inputs

String,SpreadsheetLight.SLDocument

Outputs

SpreadsheetLight.SLDocument

Notes

Examples

Example 1

apply the built-in 3colorscale style &;39;GreenyellowRed&;39; on range D4:D15.

Example 2

apply a custom 2colorscale style on range F4:F15.

Example 3

apply a custom 3colorscale style on range h4:h15.

Example 4

At times we may want to apply color scale formatting to individual rows instead of a range or rows.
This example makes use of a for-loop to loop through rows 19 to 89 while applying the built-in style of &;39;RedYellow&;39; on each row.

Related links

Stay in touch

Linkedin // RSS Feed