mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
Further polish to help
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user