mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
Get-ConditionalFormatting function added
This commit is contained in:
@@ -2,7 +2,11 @@
|
|||||||
|
|
||||||
# This example is using Excel generated by Highlight-DiffCells.ps1
|
# This example is using Excel generated by Highlight-DiffCells.ps1
|
||||||
# The displayed rule should be the same as in the PS script
|
# The displayed rule should be the same as in the PS script
|
||||||
$xlSourcefile = "$env:TEMP.\GetConditionalFormatting.xlsx"
|
|
||||||
|
function Get-ConditionalFormatting {
|
||||||
|
param (
|
||||||
|
[string] $xlSourcefile
|
||||||
|
)
|
||||||
$excel = Open-ExcelPackage -Path $xlSourcefile
|
$excel = Open-ExcelPackage -Path $xlSourcefile
|
||||||
|
|
||||||
$excel.Workbook.Worksheets | ForEach-Object {
|
$excel.Workbook.Worksheets | ForEach-Object {
|
||||||
@@ -11,3 +15,7 @@ $excel.Workbook.Worksheets | ForEach-Object {
|
|||||||
"Add-ConditionalFormatting -Worksheet `$excel[""$wsNme""] -Range '$($_.Address)' -ConditionValue '=$($_.Formula)' -RuleType $($_.Type) "
|
"Add-ConditionalFormatting -Worksheet `$excel[""$wsNme""] -Range '$($_.Address)' -ConditionValue '=$($_.Formula)' -RuleType $($_.Type) "
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$xlSourcefile = "$env:TEMP.\GetConditionalFormatting.xlsx"
|
||||||
|
Get-ConditionalFormatting -xlSourcefile $xlSourcefile
|
||||||
Reference in New Issue
Block a user