# Clear-OfficeExcelConditionalFormatting

Clears conditional formatting rules from one or more Excel worksheets.

Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

[View on GitHub](https://github.com/EvotecIT/OfficeIMO/tree/master/PowerShell/PSWriteOffice) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteOffice/releases/tag/v3.0.5) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteOffice/0.2.0)

Stars **727**

Forks **84**

Open issues **7**

Total downloads **5,275,783**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-24

Cmdlet 

Aliases: ExcelConditionalFormattingClear

**Module**

`PSWriteOffice`

**Aliases**

`ExcelConditionalFormattingClear`

**Inputs**

`OfficeIMO.Excel.ExcelDocument`

**Source**

[ClearOfficeExcelConditionalFormattingCommand.cs:18](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Excel/ClearOfficeExcelConditionalFormattingCommand.cs#L18) 

Clears conditional formatting rules from one or more Excel worksheets.

## Syntax

```
Clear-OfficeExcelConditionalFormatting
[-HeaderName <String>]
[-HeaderRow <Int32>]
[-IncludeHeader]
[-PassThru]
[-Range <String>]
[-Sheet <String>]
[-SheetIndex <Int32>]
[-TableName <String>]
[<CommonParameters>]
```

[#](#method-clear-officeexcelconditionalformatting-string-int32-switchparameter-switchparameter-string-string-int32-string)

Parameter set: `Context`

```
Clear-OfficeExcelConditionalFormatting
[-HeaderName <String>]
[-HeaderRow <Int32>]
[-IncludeHeader]
[-PassThru]
[-Path] <String>
[-Range <String>]
[-Sheet <String>]
[-SheetIndex <Int32>]
[-TableName <String>]
[<CommonParameters>]
```

[#](#method-clear-officeexcelconditionalformatting-string-int32-switchparameter-switchparameter-string-string-string-int32-string)

Parameter set: `Path`

```
Clear-OfficeExcelConditionalFormatting
-Document <ExcelDocument>
[-HeaderName <String>]
[-HeaderRow <Int32>]
[-IncludeHeader]
[-PassThru]
[-Range <String>]
[-Sheet <String>]
[-SheetIndex <Int32>]
[-TableName <String>]
[<CommonParameters>]
```

[#](#method-clear-officeexcelconditionalformatting-exceldocument-string-int32-switchparameter-switchparameter-string-string-int32-string)

Parameter set: `Document`

## Examples

### Clear stale rules from a target range.

```powershell
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.

## Parameters

**-HeaderName String optionalaliases: ColumnName**

Header or table column name used to resolve the range to clear.

**-HeaderRow Int32 optional**

Worksheet header row used when resolving HeaderName without a table. Use 0 for the first row of the used range.

**-IncludeHeader SwitchParameter optional**

Include the header cell in the resolved range.

**-PassThru SwitchParameter optional**

Emit the object created or changed by the command.

**-Range String optional**

Optional A1 range to clear. When omitted, all conditional formatting on the selected sheet is cleared.

**-Sheet String optional**

Worksheet name to update. Defaults to the current DSL sheet or all workbook sheets.

**-SheetIndex Int32 optional**

Worksheet index (0-based) to update. Defaults to the current DSL sheet or all workbook sheets.

**-TableName String optional**

Optional table name for header-based range resolution.

**-Path String requiredposition: 0aliases: FilePath, InputPathsets: Path**

Workbook path to update.

**-Document ExcelDocument requiredpipeline: True (ByValue)sets: Document**

Workbook to update outside the DSL context.

## 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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:843EBFB9701CC53CA50F4C6C4F9A013339EC98D56F97607FAB8D55F3D5DA7DB0 -->
