# Set-OfficeExcelAutoFilter

Applies a friendly AutoFilter condition by header name.

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 **725**

Forks **84**

Open issues **3**

Total downloads **5,231,343**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-23

Cmdlet 

Aliases: ExcelAutoFilterSet

**Module**

`PSWriteOffice`

**Aliases**

`ExcelAutoFilterSet`

**Inputs**

`OfficeIMO.Excel.ExcelDocument`

**Source**

[SetOfficeExcelAutoFilterCommand.cs:16](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Excel/SetOfficeExcelAutoFilterCommand.cs#L16) 

Applies a friendly AutoFilter condition by header name.

## Syntax

```
Set-OfficeExcelAutoFilter
[-Between <Double[]>]
[-Contains <String>]
[-DoesNotContain <String>]
[-EndsWith <String>]
[-GreaterThanOrEqual <Double>]
[-Header] <String>
[-LessThanOrEqual <Double>]
[-NotBetween <Double[]>]
[-NotEqual <Double>]
[-PassThru]
[-Range <String>]
[-StartsWith <String>]
[-Value <String[]>]
[<CommonParameters>]
```

[#](#method-set-officeexcelautofilter-double-string-string-string-double-string-double-double-double-switchparameter-string-string-string)

Parameter set: `Context`

```
Set-OfficeExcelAutoFilter
[-Between <Double[]>]
[-Contains <String>]
-Document <ExcelDocument>
[-DoesNotContain <String>]
[-EndsWith <String>]
[-GreaterThanOrEqual <Double>]
[-Header] <String>
[-LessThanOrEqual <Double>]
[-NotBetween <Double[]>]
[-NotEqual <Double>]
[-PassThru]
[-Range <String>]
[-Sheet <String>]
[-SheetIndex <Int32>]
[-StartsWith <String>]
[-Value <String[]>]
[<CommonParameters>]
```

[#](#method-set-officeexcelautofilter-double-string-exceldocument-string-string-double-string-double-double-double-switchparameter-string-string-int32-string-string)

Parameter set: `Document`

## Examples

### Filter a worksheet by header.

```powershell
ExcelSheet 'Data' { Set-OfficeExcelAutoFilter -Range A1:D200 -Header Status -Value Open,Hold }
```

Ensures an AutoFilter range exists and filters the Status column.

## Parameters

**-Between Double[] optional**

Inclusive numeric range condition. Provide exactly two values: minimum, maximum.

**-Contains String optional**

Text that the column value must contain.

**-DoesNotContain String optional**

Text that the column value must not contain.

**-EndsWith String optional**

Text that the column value must end with.

**-GreaterThanOrEqual Double optional**

Numeric greater-than-or-equal condition.

**-Header String requiredposition: 0aliases: ColumnName, HeaderName**

Header name to filter.

**-LessThanOrEqual Double optional**

Numeric less-than-or-equal condition.

**-NotBetween Double[] optional**

Outside numeric range condition. Provide exactly two values: minimum, maximum.

**-NotEqual Double optional**

Numeric not-equal condition.

**-PassThru SwitchParameter optional**

Emit the worksheet after applying the filter.

**-Range String optional**

Optional A1 AutoFilter range to create or replace before applying the condition.

**-StartsWith String optional**

Text that the column value must start with.

**-Value String[] optionalaliases: Values**

Allowed values for an equals filter.

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

Workbook to operate on outside the DSL context.

**-Sheet String optionalsets: Document**

Worksheet name when using Document.

**-SheetIndex Int32 optionalsets: Document**

Worksheet index (0-based) when using Document.

## 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:78188FC7E007AA1C6090B6FA8125A7C463C9F9637A06D227520C456336F57C78 -->
