< Back

New-ConditionalFormattingIconSet

Wed Jan 15, 2020 1:01 am

NAME New-ConditionalFormattingIconSet



SYNOPSIS

Creates an object which describes a conditional formatting rule a for 3,4 or 5 icon set.





SYNTAX

New-ConditionalFormattingIconSet [-Range] <Object> [[-ConditionalFormat] <Object>] [-Reverse] [<CommonParameters>]





DESCRIPTION

Export-Excel takes a -ConditionalFormat parameter which can hold one or more descriptions for conditional formats;

this command builds the defintion of a Conditional formatting rule for an icon set.





PARAMETERS

-Range <Object>

The range of cells that the conditional format applies to.



Required? true

Position? 1

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ConditionalFormat <Object>

The type of rule: one of "ThreeIconSet","FourIconSet" or "FiveIconSet"



Required? false

Position? 2

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Reverse [<SwitchParameter>]

Use the icons in the reverse order.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES









-------------------------- EXAMPLE 1 --------------------------



PS\\> $cfRange = [OfficeOpenXml.ExcelAddress]::new($topRow, $column, $lastDataRow, $column)

PS\\> $cfdef = New-ConditionalFormattingIconSet -Range $cfrange -ConditionalFormat ThreeIconSet -IconType Arrows

PS\\> Export-Excel -ExcelPackage $excel -ConditionalFormat $cfdef -show



The first line creates a range - one column wide in the column $column, running from $topRow to $lastDataRow. The

second line creates a definition object using this range and the third uses Export-Excel with an open package to

apply the format and save and open the file.



RELATED LINKS

Add-Add-ConditionalFormatting

New-ConditionalText