API Reference
Cmdlet
Clear-OfficeExcelConditionalFormatting
Clears conditional formatting rules from one or more Excel worksheets.
Remarks
Clears conditional formatting rules from one or more Excel worksheets.
Examples
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:
ContextParameters
- HeaderName String
- Header or table column name used to resolve the range to clear.
- HeaderRow Int32
- Worksheet header row used when resolving HeaderName without a table. Use 0 for the first row of the used range.
- IncludeHeader SwitchParameter
- Include the header cell in the resolved range.
- Range String
- Optional A1 range to clear. When omitted, all conditional formatting on the selected sheet is cleared.
- Sheet String
- Worksheet name to update. Defaults to the current DSL sheet or all workbook sheets.
- SheetIndex Nullable`1
- Worksheet index (0-based) to update. Defaults to the current DSL sheet or all workbook sheets.
- TableName String
- 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:
PathParameters
- HeaderName String
- Header or table column name used to resolve the range to clear.
- HeaderRow Int32
- Worksheet header row used when resolving HeaderName without a table. Use 0 for the first row of the used range.
- IncludeHeader SwitchParameter
- Include the header cell in the resolved range.
- InputPath String
- Workbook path to update.
- Range String
- Optional A1 range to clear. When omitted, all conditional formatting on the selected sheet is cleared.
- Sheet String
- Worksheet name to update. Defaults to the current DSL sheet or all workbook sheets.
- SheetIndex Nullable`1
- Worksheet index (0-based) to update. Defaults to the current DSL sheet or all workbook sheets.
- TableName String
- 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:
DocumentParameters
- Document ExcelDocument
- Workbook to update outside the DSL context.
- HeaderName String
- Header or table column name used to resolve the range to clear.
- HeaderRow Int32
- Worksheet header row used when resolving HeaderName without a table. Use 0 for the first row of the used range.
- IncludeHeader SwitchParameter
- Include the header cell in the resolved range.
- Range String
- Optional A1 range to clear. When omitted, all conditional formatting on the selected sheet is cleared.
- Sheet String
- Worksheet name to update. Defaults to the current DSL sheet or all workbook sheets.
- SheetIndex Nullable`1
- Worksheet index (0-based) to update. Defaults to the current DSL sheet or all workbook sheets.
- TableName String
- Optional table name for header-based range resolution.
Outputs
System.Object