mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-18 17:23:51 +00:00
add clearall to set-ExcelRange;
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
Set-ExcelRow -Worksheet $ws -Heading Total -Value {"=sum($columnName`2:$columnName$endrow)" }
|
Set-ExcelRow -Worksheet $ws -Heading Total -Value {"=sum($columnName`2:$columnName$endrow)" }
|
||||||
|
|
||||||
$Ws contains a worksheet object, and no Row number is specified so
|
$Ws contains a worksheet object, and no Row number is specified so
|
||||||
Set-ExcelRow will select the next row after the endof the data in
|
Set-ExcelRow will select the next row after the end of the data in
|
||||||
the sheet. The first cell in the row will contain "Total", and
|
the sheet. The first cell in the row will contain "Total", and
|
||||||
each of the other cells will contain
|
each of the other cells will contain
|
||||||
=Sum(xx2:xx99)
|
=Sum(xx2:xx99)
|
||||||
|
|||||||
@@ -124,7 +124,10 @@
|
|||||||
$Range = $WorkSheet.Cells[$Range]
|
$Range = $WorkSheet.Cells[$Range]
|
||||||
}
|
}
|
||||||
elseif ($Range -is [string]) {Write-Warning -Message "The range pararameter you have specified also needs a worksheet parameter." ;return}
|
elseif ($Range -is [string]) {Write-Warning -Message "The range pararameter you have specified also needs a worksheet parameter." ;return}
|
||||||
#else we assume Range is a range.
|
#else we assume $Range is a range.
|
||||||
|
if ($ClearAll) {
|
||||||
|
$Range.Clear()
|
||||||
|
}
|
||||||
if ($ResetFont) {
|
if ($ResetFont) {
|
||||||
$Range.Style.Font.Color.SetColor( ([System.Drawing.Color]::Black))
|
$Range.Style.Font.Color.SetColor( ([System.Drawing.Color]::Black))
|
||||||
$Range.Style.Font.Bold = $false
|
$Range.Style.Font.Bold = $false
|
||||||
@@ -332,6 +335,7 @@ if (Get-Command -ErrorAction SilentlyContinue -name Register-ArgumentCompleter)
|
|||||||
Register-ArgumentCompleter -CommandName Set-ExcelRange -ParameterName FontName -ScriptBlock $Function:ListFonts
|
Register-ArgumentCompleter -CommandName Set-ExcelRange -ParameterName FontName -ScriptBlock $Function:ListFonts
|
||||||
Register-ArgumentCompleter -CommandName Set-ExcelRow -ParameterName FontName -ScriptBlock $Function:ListFonts
|
Register-ArgumentCompleter -CommandName Set-ExcelRow -ParameterName FontName -ScriptBlock $Function:ListFonts
|
||||||
}
|
}
|
||||||
|
|
||||||
function Expand-NumberFormat {
|
function Expand-NumberFormat {
|
||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
|
|||||||
Reference in New Issue
Block a user