Set-SLCellFormat


Synopsis

Apply string formatting to cells.

Syntax

Description

Apply string formatting to cells.A single or a range of cells can be specified as input

Parameters

-WorkBookInstance

Instance of an excel document that can be used for editing.

Required? True
Position? 0
Default value  
Accept pipeline input? true (ByValue)
Accept wildcard characters? False

-WorksheetName

Name of the Worksheet that is to be processed.

Required? False
Position? 1
Default value  
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? False

-CellReference

The target cell for stringformat. Eg: J3.

Required? True
Position? 2
Default value  
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? False

-FormatString

The format to be set on a particular cell or cells Eg. &;39;d mm yyyy&;39;.

Required? True
Position? 3
Default value  
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? False

-Range

The target range for stringformat. Eg: J3:K4.

Required? True
Position? 2
Default value  
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? False

This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

Inputs

String,SpreadsheetLight.SLDocument

Outputs

SpreadsheetLight.SLDocument

Notes

Examples

Example 1

Apply stringformat to cell d4. Here the format string – &;39;000\-00\-0000&;39; uses the pattern for matching a “social security number”.

Example 2

Formatstring is applied to a range j3:l5.

Example 3

Example showing different formats applied to values in the cell range B3:B8.

Related links

http://office.microsoft.com/en-us/excel-help/number-format-codes-HP005198679.aspx
http://www.databison.com/custom-format-in-excel-how-to-format-numbers-and-text/