Set-SLBorder


Synopsis

Set Border Style on a single or a range of cells.

Syntax

Description

Set Border Style on a single or a range of cells.

Parameters

-WorkBookInstance

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

Required? True
Position? 1
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 that needs to have the specified border settings. Eg: A5 or AB10

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

-BorderStyle

Valid values for the border style parameter are as follows:
&;39;Thick&;39;,&;39;Thin&;39;,&;39;Double&;39;,&;39;Dotted&;39;,&;39;Hair&;39;,&;39;Dashed&;39;,&;39;DashDot&;39;,&;39;DashDotDot&;39;,&;39;SlantDashDot&;39;,&;39;Medium&;39;,&;39;MediumDashDot&;39;,&;39;MediumDashDotDot&;39;,&;39;MediumDashed&;39;.

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

-BorderColor

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

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

-LeftBorder

Specify style settings that apply to the left border of a cell or cell range.

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

-RightBorder

Specify style settings that apply to the right border of a cell or cell range.

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

-TopBorder

Specify style settings that apply to the top border of a cell or cell range.

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

-BottomBorder

Specify style settings that apply to the Bottom border of a cell or cell range.

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

-VerticalBorder

Specify style settings that apply to the vertical border of a cell or cell range.

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

-HoriZontalBorder

Specify style settings that apply to the Horizontal border of a cell or cell range.

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

-CellBorder

Specify style settings that apply to the whole cell i.e., Left,right,top,bottom.

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

-DiagonalBorder

Specify style settings that apply to the DiagonalUp & DiagonalDown border of a cell or cell range.

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

-Range

The target cell range that needs to have the specified border 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 a border style to cell D3 using the switch &;39;-Cellborder&;39; which means apply the same style to all the borders of the cell D3.

Example 2

Apply border style to a range of cells (d15:f24)

Example 3

Here we apply a different border style to each side of the cell range d15:f24.
Notice that we had to specify the worksheetname and range parameters only once.

Example 4

Similar to the previous example except that in this case we specify a different border setting for different ranges.
Notice that we had to specify the worksheetname parameter only once.

Related links