mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
Merge branch 'master' into Investigate-underlinetype-not-being-set
This commit is contained in:
26
Examples/ConditionalFormatting/Highlight-DiffCells.ps1
Normal file
26
Examples/ConditionalFormatting/Highlight-DiffCells.ps1
Normal file
@@ -0,0 +1,26 @@
|
||||
try { Import-Module $PSScriptRoot\..\..\ImportExcel.psd1 } catch { throw ; return }
|
||||
|
||||
# Get rid of pre-exisiting sheet
|
||||
$xlSourcefile = "$env:TEMP\ImportExcelExample.xlsx"
|
||||
|
||||
Write-Verbose -Verbose -Message "Save location: $xlSourcefile"
|
||||
Remove-Item $xlSourcefile -ErrorAction Ignore
|
||||
|
||||
$data = ConvertFrom-Csv @"
|
||||
Region,State,Units2021,Units2022
|
||||
West,Texas,927,925
|
||||
North,Tennessee,466,466
|
||||
East,Florida,520,458
|
||||
East,Maine,828,661
|
||||
West,Virginia,465,465
|
||||
North,Missouri,436,235
|
||||
South,Kansas,214,214
|
||||
North,North Dakota,789,640
|
||||
South,Delaware,712,508
|
||||
"@
|
||||
|
||||
$excel = $data | Export-Excel $xlSourcefile -AutoSize -PassThru
|
||||
|
||||
Add-ConditionalFormatting -Worksheet $excel.sheet1 -Range "C2:C10" -ConditionValue '=C2=D2' -RuleType Expression -BackgroundColor Cyan
|
||||
|
||||
Close-ExcelPackage $excel -Show
|
||||
@@ -2,11 +2,17 @@
|
||||
|
||||
- Fix a bug with `-UnderLineType parameter is ignored in Set-ExcelColumn` [#1204](https://github.com/dfinke/ImportExcel/issues/1204)
|
||||
|
||||
# Example added
|
||||
|
||||
Thank you [@kkazala](https://github.com/kkazala)
|
||||
- Added an example showing `ConditionalFormatting` using the `RuleType` `Expression` with a formula
|
||||
- [Highlight-DiffCells.ps1](https://github.dev/kkazala/ImportExcel/blob/b53881fd023c052da1acc7812511da223bb2e40c/Examples/ConditionalFormatting/Highlight-DiffCells.ps1)
|
||||
|
||||
# 7.6.0
|
||||
|
||||
- **_[Under investigation]_** Fix -StartRow and -StartColumn being ignored.
|
||||
- James O'Neill:
|
||||
- Update Get-HtmlTable to support to use PowerHTML (maintained by [Justin Grote](https://twitter.com/**JustinWGrote**)).
|
||||
- Update Get-HtmlTable to support to use PowerHTML (maintained by [Justin Grote](https://twitter.com/JustinWGrote)).
|
||||
- Added example to including a new function Import-ByColumn. Works like Import-Excel but with data in columns instead of the conventional rows.
|
||||
- Update Import-HTML with better defaults
|
||||
- Fixed example `Get-ModuleStats.ps1` which reads the PowerShell Gallery page and extracts the stats table
|
||||
|
||||
Reference in New Issue
Block a user