Further polish to help

This commit is contained in:
jhoneill
2018-09-11 15:34:37 +01:00
parent 3ff59907ff
commit e09c5e5207
7 changed files with 86 additions and 61 deletions

View File

@@ -8,19 +8,19 @@
A column heading can be specified and the new column can be made a named range.
The column can be formatted in the same operation.
.EXAMPLE
C:\> Set-ExcelColumn -Worksheet $ws -Column 5 -NumberFormat 'Currency'
Set-ExcelColumn -Worksheet $ws -Column 5 -NumberFormat 'Currency'
$ws contains a worksheet object - and column E is set to use the local currecy format.
Intelisense will complete predefined number formats. You can see how currency is interpreted on the local computer with the command
Expand-NumberFormat currency
.EXAMPLE
C:\> Set-ExcelColumn -Worksheet $ws -Heading "WinsToFastLaps" -Value {"=E$row/C$row"} -Column 7 -AutoSize -AutoNameRange
Set-ExcelColumn -Worksheet $ws -Heading "WinsToFastLaps" -Value {"=E$row/C$row"} -Column 7 -AutoSize -AutoNameRange
Here $WS already contains a worksheet which contains counts of races won and fastest laps recorded by racing drivers (in columns C and E)
Set-ExcelColumn specifies that Column 7 should have a heading of "WinsToFastLaps" and the data cells should contain =E2/C2 , =E3/C3 etc
the data cells should become a named range, which will also be "WinsToFastLaps" the column width will be set automatically
.EXAMPLE
C:\> Set-ExcelColumn -Worksheet $ws -Heading "Link" -Value {"https://en.wikipedia.org" + $worksheet.cells["B$Row"].value } -AutoSize
Set-ExcelColumn -Worksheet $ws -Heading "Link" -Value {"https://en.wikipedia.org" + $worksheet.cells["B$Row"].value } -AutoSize
In this example, the worksheet in $ws has partial links to wikipedia pages in column B.
The Value parameter is is a script block and it outputs a string which begins https... and ends with the value of cell at column B in the current row.