Files
ImportExcel/Set-CellStyle.ps1
2016-12-22 11:24:18 -05:00

13 lines
341 B
PowerShell

function Set-CellStyle {
param(
$WorkSheet,
$Row,
$LastColumn,
[OfficeOpenXml.Style.ExcelFillStyle]$Pattern,
[System.Drawing.Color]$Color
)
$t=$WorkSheet.Cells["A$($Row):$($LastColumn)$($Row)"]
$t.Style.Fill.PatternType=$Pattern
$t.Style.Fill.BackgroundColor.SetColor($Color)
}