Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Find-OfficeExcel

Module PSWriteOffice
Inputs
OfficeIMO.Excel.ExcelDocument
Outputs
System.Management.Automation.PSObject

Finds text in worksheet values.

Syntax

Find-OfficeExcel [-CaseSensitive] [-Exact] [-Path] <String> [-Range <String>] [-Regex] [-Sheet <String>] [-SheetIndex <Int32>] [-Text] <String> [<CommonParameters>]
#
Parameter set: Path
Find-OfficeExcel [-CaseSensitive] -Document <ExcelDocument> [-Exact] [-Range <String>] [-Regex] [-Sheet <String>] [-SheetIndex <Int32>] [-Text] <String> [<CommonParameters>]
#
Parameter set: Document

Examples

Authored help example

Find status values and export their addresses.

$matches = Find-OfficeExcel -Path .\Report.xlsx -Text Ready -Sheet Summary
$matches |
    Select-Object -Property Sheet, Address, Value |
    Export-Csv -Path .\ReadyCells.csv -NoTypeInformation

Returns matching cells with sheet, address, row, column, and value metadata for review or proof.

Parameters

-CaseSensitive SwitchParameter optional
Use case-sensitive matching.
-Exact SwitchParameter optional
Require an exact cell text match instead of substring matching.
-Path String requiredposition: 0aliases: FilePath, InputPathsets: Path
Workbook path to inspect.
-Range String optional
A1 range to search. Defaults to each selected worksheet's used range.
-Regex SwitchParameter optional
Treat -Text as a regular expression.
-Sheet String optionalaliases: WorksheetName
Worksheet name. Defaults to all sheets for path/document use and current sheet inside an ExcelSheet block.
-SheetIndex Int32 optional
Worksheet index when using a workbook object or path.
-Text String requiredposition: 1
Text or pattern to find.
-Document ExcelDocument requiredpipeline: True (ByValue)sets: Document
Workbook to inspect 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.