OfficeIMO

API Reference

Command

Add-OfficeExcelConditionalRule

Namespace PSWriteOffice
Inputs
OfficeIMO.Excel.ExcelDocument
Outputs
System.Object

Adds a conditional formatting rule to the current worksheet.

Remarks

Adds a conditional formatting rule to the current worksheet.

Examples

Highlight values greater than 100.


PS>ExcelSheet 'Data' { Add-OfficeExcelConditionalRule -Range 'C2:C100' -Operator GreaterThan -Formula1 '100' }
        

Applies a conditional rule to column C.

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.

Syntax

Add-OfficeExcelConditionalRule -Formula1 <String> [-Formula2 <String>] -Operator <String> [-PassThru] -Range <String> [<CommonParameters>]
#
Parameter set: Context

Parameters

Formula1 String requiredposition: 2pipeline: False
Primary formula or value.
Formula2 String optionalposition: namedpipeline: False
Optional secondary formula or value.
Operator String requiredposition: 1pipeline: False
Conditional formatting operator.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the range after applying the rule.
Range String requiredposition: 0pipeline: False
A1 range to apply the rule to.

Outputs

System.Object

Add-OfficeExcelConditionalRule -Document <ExcelDocument> -Formula1 <String> [-Formula2 <String>] -Operator <String> [-PassThru] -Range <String> [-Sheet <String>] [-SheetIndex <Nullable`1>] [<CommonParameters>]
#
Parameter set: Document

Parameters

Document ExcelDocument requiredposition: namedpipeline: True (ByValue)
Workbook to operate on outside the DSL context.
Formula1 String requiredposition: 2pipeline: False
Primary formula or value.
Formula2 String optionalposition: namedpipeline: False
Optional secondary formula or value.
Operator String requiredposition: 1pipeline: False
Conditional formatting operator.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the range after applying the rule.
Range String requiredposition: 0pipeline: False
A1 range to apply the rule to.
Sheet String optionalposition: namedpipeline: False
Worksheet name when using Document.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index (0-based) when using Document.

Outputs

System.Object