API Reference
Command
Add-OfficeExcelAutoFilter
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:
ContextParameters
- Criteria Hashtable
- Optional criteria per column index (0-based within the range).
- Range String
- A1 range to apply AutoFilter.
Outputs
System.Object
Add-OfficeExcelAutoFilter [-Criteria <Hashtable>] -Document <ExcelDocument> -Range <String> [-Sheet <String>] [-SheetIndex <Nullable`1>] [<CommonParameters>]#Parameter set:
DocumentParameters
- Criteria Hashtable
- Optional criteria per column index (0-based within the range).
- Document ExcelDocument
- Workbook to operate on outside the DSL context.
- Range String
- A1 range to apply AutoFilter.
- Sheet String
- Worksheet name when using Document.
- SheetIndex Nullable`1
- Worksheet index (0-based) when using Document.
Outputs
System.Object