Show Icon Only in New-ConditionalFormattingIconSet #1340
-
Firstly, thanks for this package - it's absolutely superb and incredibly useful. Quick question - is it possible to only show the icon (as against icon and value) when configuring New-ConditionalFormattingIconSet? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Please post an example |
Beta Was this translation helpful? Give feedback.
-
Thanks for posting. It'd be easier if you could set this when you do the $data = ConvertFrom-Csv @"
Region,State,Units,Price,InStock
West,Texas,927,923.71,1
North,Tennessee,466,770.67,0
East,Florida,520,458.68,1
East,Maine,828,661.24,0
West,Virginia,465,053.58,1
North,Missouri,436,235.67,1
South,Kansas,214,992.47,1
North,North Dakota,789,640.72,0
South,Delaware,712,508.55,1
"@
$xlfile = "$PSScriptRoot\test.xlsx"
Remove-Item $xlfile -ErrorAction SilentlyContinue
$cfi = New-ConditionalFormattingIconSet -Range E:E -ConditionalFormat ThreeIconSet -IconType Symbols2
$excel = $data | Export-Excel $xlfile -AutoSize -ConditionalFormat $cfi -PassThru
$excel.Sheet1.ConditionalFormatting[0].ShowValue = $false
Close-ExcelPackage $excel -Show |
Beta Was this translation helpful? Give feedback.
-
Add -ShowOnlyIcon to New-ConditionalFormattingIconSet - #1341 |
Beta Was this translation helpful? Give feedback.
Thanks for posting.
New-ConditionalFormattingIconSet
does not have a-ShowValues
option to turn that off.Here is a way to get at that setting. The
$excel.Sheet1.ConditionalFormatting
is array, so you need to correctly identify the one or more you want to turn off.It'd be easier if you could set this when you do the
New
. I need to think about that.