mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
Added new conditional formatting
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user