API Reference

Cmdlet

Clear-OfficeExcelConditionalFormatting

Aliases: ExcelConditionalFormattingClear
Namespace PSWriteOffice
Aliases
ExcelConditionalFormattingClear
Inputs
OfficeIMO.Excel.ExcelDocument
Outputs
System.Object

Clears conditional formatting rules from one or more Excel worksheets.

Remarks

Clears conditional formatting rules from one or more Excel worksheets.

Examples

Authored help example

Clear stale rules from a target range.

PS>


Clear-OfficeExcelConditionalFormatting -Path .\Report.xlsx -Sheet Data -HeaderName Status -TableName ServiceHealth -Confirm:$false
            Get-OfficeExcelConditionalFormatting -Path .\Report.xlsx -Sheet Data |
                Where-Object Range -like '*Status*'
        

Removes conditional formatting metadata that overlaps the target range and saves the workbook.

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

Clear-OfficeExcelConditionalFormatting [-HeaderName <String>] [-HeaderRow <Int32>] [-IncludeHeader] [-Range <String>] [-Sheet <String>] [-SheetIndex <Nullable`1>] [-TableName <String>] [<CommonParameters>]
#
Parameter set: Context

Parameters

HeaderName String optionalposition: namedpipeline: Falsealiases: ColumnName
Header or table column name used to resolve the range to clear.
HeaderRow Int32 optionalposition: namedpipeline: False
Worksheet header row used when resolving HeaderName without a table. Use 0 for the first row of the used range.
IncludeHeader SwitchParameter optionalposition: namedpipeline: False
Include the header cell in the resolved range.
Range String optionalposition: namedpipeline: False
Optional A1 range to clear. When omitted, all conditional formatting on the selected sheet is cleared.
Sheet String optionalposition: namedpipeline: False
Worksheet name to update. Defaults to the current DSL sheet or all workbook sheets.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index (0-based) to update. Defaults to the current DSL sheet or all workbook sheets.
TableName String optionalposition: namedpipeline: False
Optional table name for header-based range resolution.

Outputs

System.Object

Clear-OfficeExcelConditionalFormatting [-HeaderName <String>] [-HeaderRow <Int32>] [-IncludeHeader] -InputPath <String> [-Range <String>] [-Sheet <String>] [-SheetIndex <Nullable`1>] [-TableName <String>] [<CommonParameters>]
#
Parameter set: Path

Parameters

HeaderName String optionalposition: namedpipeline: Falsealiases: ColumnName
Header or table column name used to resolve the range to clear.
HeaderRow Int32 optionalposition: namedpipeline: False
Worksheet header row used when resolving HeaderName without a table. Use 0 for the first row of the used range.
IncludeHeader SwitchParameter optionalposition: namedpipeline: False
Include the header cell in the resolved range.
InputPath String requiredposition: 0pipeline: Falsealiases: FilePath, Path
Workbook path to update.
Range String optionalposition: namedpipeline: False
Optional A1 range to clear. When omitted, all conditional formatting on the selected sheet is cleared.
Sheet String optionalposition: namedpipeline: False
Worksheet name to update. Defaults to the current DSL sheet or all workbook sheets.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index (0-based) to update. Defaults to the current DSL sheet or all workbook sheets.
TableName String optionalposition: namedpipeline: False
Optional table name for header-based range resolution.

Outputs

System.Object

Clear-OfficeExcelConditionalFormatting -Document <ExcelDocument> [-HeaderName <String>] [-HeaderRow <Int32>] [-IncludeHeader] [-Range <String>] [-Sheet <String>] [-SheetIndex <Nullable`1>] [-TableName <String>] [<CommonParameters>]
#
Parameter set: Document

Parameters

Document ExcelDocument requiredposition: namedpipeline: True (ByValue)
Workbook to update outside the DSL context.
HeaderName String optionalposition: namedpipeline: Falsealiases: ColumnName
Header or table column name used to resolve the range to clear.
HeaderRow Int32 optionalposition: namedpipeline: False
Worksheet header row used when resolving HeaderName without a table. Use 0 for the first row of the used range.
IncludeHeader SwitchParameter optionalposition: namedpipeline: False
Include the header cell in the resolved range.
Range String optionalposition: namedpipeline: False
Optional A1 range to clear. When omitted, all conditional formatting on the selected sheet is cleared.
Sheet String optionalposition: namedpipeline: False
Worksheet name to update. Defaults to the current DSL sheet or all workbook sheets.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index (0-based) to update. Defaults to the current DSL sheet or all workbook sheets.
TableName String optionalposition: namedpipeline: False
Optional table name for header-based range resolution.

Outputs

System.Object