Set-SLFill


Synopsis

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

Syntax

Description

Set Fill 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

-TargetCellorRange

The target cellreference or Range that needs to have the specified fill settings. Eg: A5 or A5:B10
Due to the complexity involved in setting up the various fill methods the cellreference and range parameters have been combined as TargetcellorRage.

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

-Color

The fill color to be set.

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

-ColorFromHTML

The fill color from an HTML string such as &;39;#12b1e6&;39;.

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

-ThemeColor

Use tab or intellisense to select from a range of possible values.
Possible values are:
&;39;Accent1Color&;39;,&;39;Accent2Color&;39;,&;39;Accent3Color&;39;,&;39;Accent4Color&;39;,&;39;Accent5Color&;39;,
&;39;Accent6Color&;39;,&;39;Dark1Color&;39;,&;39;Dark2Color&;39;,&;39;Light1Color&;39;,
&;39;Light2Color&;39;,&;39;Hyperlink&;39;,&;39;FollowedHyperlinkColor&;39;

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

-Pattern

Use tab or intellisense to select from a range of possible values.
Possible values are:
&;39;DarkDown&;39;,&;39;DarkGray&;39;,&;39;DarkGrid&;39;,&;39;DarkHorizontal&;39;,&;39;DarkTrellis&;39;,
&;39;DarkUp&;39;,&;39;DarkVertical&;39;,&;39;Gray0625&;39;,&;39;Gray125&;39;,
&;39;LightDown&;39;,&;39;LightGray&;39;,&;39;LightGrid&;39;,&;39;LightHorizontal&;39;,
&;39;LightTrellis&;39;,&;39;LightUp&;39;,&;39;LightVertical&;39;,&;39;MediumGray&;39;,&;39;None&;39;,&;39;Solid&;39;

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

-ForeGroundThemeColor

The ForeGroundThemeColor fill color to be set. Values are the same as the parameter &;39;Themecolor&;39;.

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

-BackGroundThemeColor

The BackGroundThemeColor fill color to be set. Values are the same as the parameter &;39;Themecolor&;39;.

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

-ForeGroundColor

The ForeGroundColor fill color to be set. Values are the same as the parameter &;39;color&;39;.

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

-BackGroundColor

The BackGroundColor fill color to be set. Values are the same as the parameter &;39;color&;39;.

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

-GradientDirection

Use tab or intellisense to select from a range of possible values.
Possible values are:
&;39;Corner1&;39;,&;39;Corner2&;39;,&;39;Corner3&;39;,&;39;Corner4&;39;,&;39;DiagonalDown1&;39;,
&;39;DiagonalDown2&;39;,&;39;DiagonalDown3&;39;,&;39;DiagonalUp1&;39;,&;39;DiagonalUp2&;39;,
&;39;DiagonalUp3&;39;,&;39;Horizontal1&;39;,&;39;Horizontal2&;39;,&;39;Horizontal3&;39;,
&;39;Vertical1&;39;,&;39;Vertical2&;39;,&;39;Vertical3&;39;,&;39;FromCenter&;39;

Required? True
Position? named
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 fill color Aqua to cell B2

Example 2

Apply fill themecolor Accent2Color to cell B3.

Example 3

Apply pattern darkdown with two different Foreground and background colors to cell B4.

Example 4

Apply pattern darkgray with two different Foreground and background Themecolors to cell B5.

Example 5

Apply pattern darkgrid with a themecolor and a regular color value to cell B6.

Example 6

Copy the range g2:g8 and paste it at G10 filling up cells G10:I16.
Set font and alignment settings on the header range G10:I16 and apply a fill color &;39;#12b1e6&;39;
Set a different font and fill color on the first data column. Font Tahoma & color Tan
To provide contrast apply a light background fill on the remaining data columns H11:I16
Dont forget to save the document :).

Related links