add clearall to set-ExcelRange;

This commit is contained in:
jhoneill
2019-07-24 12:01:06 +01:00
parent 8b28172616
commit 8759070636
2 changed files with 6 additions and 2 deletions

View File

@@ -13,7 +13,7 @@
Set-ExcelRow -Worksheet $ws -Heading Total -Value {"=sum($columnName`2:$columnName$endrow)" }
$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
each of the other cells will contain
=Sum(xx2:xx99)

View File

@@ -124,7 +124,10 @@
$Range = $WorkSheet.Cells[$Range]
}
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) {
$Range.Style.Font.Color.SetColor( ([System.Drawing.Color]::Black))
$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-ExcelRow -ParameterName FontName -ScriptBlock $Function:ListFonts
}
function Expand-NumberFormat {
<#
.SYNOPSIS