Set-SLFont


Synopsis

Set Font settings on a single or a range of cells.

Syntax

Description

Set Font settings on a single or a range of cells.

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? True
Position? 1
Default value  
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? False

-CellReference

The target cell that needs to have the specified font settings. Eg: A5 or AB10

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

-FontName

Name of the font.

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

-FontSize

Size of the font.

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

-FontColor

Color of the font. Use tab completion or intellisense to select a possible value from a list provided by the parameter.

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

-Underline

Specifies the underline formatting style of the font text.Valid values are:&;39;Single&;39;,&;39;Double&;39;,&;39;SingleAccounting&;39;,&;39;DoubleAccounting&;39;,&;39;None&;39;

Required? False
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-IsBold

Specifies if the font text should be bold.

Required? False
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-IsItalic

Specifies if the font text should be italic.

Required? False
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-IsStrikenThrough

Specifies if the font text should have a strikethrough.

Required? False
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-Range

The target cell range that needs to have the specified font settings. Eg: A5:B10 or AB10:AD20

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 Underline,Bold & Strikethrough settings to cell C15

Example 2

Apply font settings to a range of cells (g4:l5)

Example 3

Set the cell value of B3 to &;39;Hello&;39; and then set the font settings. Notice how we did not have to specify the -worksheetname and -cellreference parameters
for the &;39;Set-SLFont&;39; function. This is because we already specified values for those parameters once for the &;39;Set-SLCellvalue&;39; function so the output
of this function becomes the input for Set-SLFont.

Related links