Added new conditional formatting

This commit is contained in:
dfinke
2016-01-19 17:31:16 -05:00
parent d0d79d8bf7
commit fc3a17bec8
2 changed files with 23 additions and 6 deletions

View File

@@ -341,10 +341,16 @@ function Export-Excel {
foreach ($targetConditionalText in $ConditionalText) {
$target = "Add$($targetConditionalText.ConditionalType)"
$rule=($ws.Cells[$ws.Dimension.Address].ConditionalFormatting).$target()
$rule.Text = $targetConditionalText.Text
$rule.Style.Font.Color.Color = $targetConditionalText.ConditionalTextColor
$Range=$targetConditionalText.Range
if(!$Range) { $Range=$ws.Dimension.Address }
$rule=($ws.Cells[$Range].ConditionalFormatting).$target()
if($targetConditionalText.Text) {
$rule.Text = $targetConditionalText.Text
}
$rule.Style.Font.Color.Color = $targetConditionalText.ConditionalTextColor
$rule.Style.Fill.PatternType=$targetConditionalText.PatternType
$rule.Style.Fill.BackgroundColor.Color=$targetConditionalText.BackgroundColor
}