OfficeIMO

API Reference

Command

Add-OfficeExcelAutoFilter

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

Adds an AutoFilter to the current worksheet.

Remarks

Adds an AutoFilter to the current worksheet.

Examples

Add AutoFilter to a range.


PS>ExcelSheet 'Data' { Add-OfficeExcelAutoFilter -Range 'A1:D200' }
        

Enables filter dropdowns on the range.

Add AutoFilter with criteria.


PS>Add-OfficeExcelAutoFilter -Range 'A1:D200' -Criteria @{ 2 = 'Open','Hold' }
        

Filters the third column (0-based within the range) to Open/Hold.

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-OfficeExcelAutoFilter [-Criteria <Hashtable>] -Range <String> [<CommonParameters>]
#
Parameter set: Context

Parameters

Criteria Hashtable optionalposition: namedpipeline: False
Optional criteria per column index (0-based within the range).
Range String requiredposition: 0pipeline: False
A1 range to apply AutoFilter.

Outputs

System.Object

Add-OfficeExcelAutoFilter [-Criteria <Hashtable>] -Document <ExcelDocument> -Range <String> [-Sheet <String>] [-SheetIndex <Nullable`1>] [<CommonParameters>]
#
Parameter set: Document

Parameters

Criteria Hashtable optionalposition: namedpipeline: False
Optional criteria per column index (0-based within the range).
Document ExcelDocument requiredposition: namedpipeline: True (ByValue)
Workbook to operate on outside the DSL context.
Range String requiredposition: 0pipeline: False
A1 range to apply AutoFilter.
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