Skip to main content

Replace Text in Excel in Make

Replace Text in Excel is a bulk find-and-replace operation that searches every cell across all worksheets in an Excel workbook, substitutes matching text using literal or regex patterns, and optionally applies font formatting to the replaced content. PDF4me processes all worksheets in a single API call, supporting multiple replacement phrases sequentially, making it suitable for data standardization, rebranding, and automated content updates without opening Excel. For details on Excel text functions and find-replace behavior, see Microsoft Excel SUBSTITUTE function and Open XML SDK text handling.

What this module does

PDF4me Excel, Replace Text searches and replaces text across all worksheets of an Excel workbook in your Make scenario. Add one or more Phrases array items: each specifies a SearchText pattern, a ReplacementText value, and optional flags for regex, case sensitivity, and whole-cell matching. You can also apply font formatting to replaced content. All replacements run sequentially in a single API call and the updated workbook is returned ready to upload or pass downstream.

Related Blog Posts
No blog post yet for this feature — coming soon.
In the meantime, browse the PDF4me blog for tutorials and workflows across every platform.
Visit the blog

Authenticating Your API Request

Every PDF4me module in Make requires a valid Connection. Create or select one that holds your PDF4me API key so the scenario can authenticate text replacement requests securely.

Important Facts You Should Not Miss

All worksheets are always processed
The Replace Text module searches and replaces across every worksheet in the workbook automatically. There is no parameter to restrict processing to specific sheets. Every tab is included in a single pass, which ensures no stale references remain in hidden or secondary worksheets.
Regex capture groups work in ReplacementText
When IsExpression is true, use $1, $2, etc. in ReplacementText to reference capture groups from the SearchText regex pattern. For example, a pattern matching phone number parts can reassemble them into a standard format. Phrase items are processed in array order, so plan your sequence carefully when chaining replacements.
Formatting applies only to replaced content
The optional Formatting object in each Phrases item applies font changes (color, bold, italic, size, underline) only to the text that was substituted, not to the entire cell. Set Bold, Italic to Apply, Remove, or Inherit. This lets you visually highlight updated content without reformatting surrounding text in the same cell.
Make PDF4me Excel Replace Text module showing File Name and Document mapped from prior module, and Phrases array with SearchText, ReplacementText, and formatting options

File Name and Document are mapped from a prior module. The Phrases array accepts multiple search-replace operations processed in order.

Parameters

Required: Connection, File Name, Document, and at least one item in the Phrases array (with SearchText and ReplacementText) must be provided. All other Phrases properties and Formatting are optional.

ParameterRequiredWhat it doesExample
ConnectionRequiredPDF4me API connection. Click Add and paste your API key if connecting for the first time.Your PDF4me connection
File NameRequiredExcel filename with extension. Map from the prior module's file name output.data.xlsx
DocumentRequiredBinary Excel buffer from a cloud storage download (Google Drive, Dropbox, SharePoint), email attachment, or HTTP response.1. Data
Phrases: SearchTextRequiredText or regex pattern to search for. Use with IsExpression true for regex. Processed across all worksheets.OldCorp Inc.
Phrases: ReplacementTextRequiredText to substitute for each SearchText match. Set to empty string to delete the matched text without inserting anything.NewCorp LLC
Phrases: IsExpressionConditionalSet true to treat SearchText as a regex pattern. Supports capture groups ($1, $2) in ReplacementText. Default is false (literal match).false
Phrases: CaseSensitiveConditionalSet true for case-sensitive matching. Default is false: "oldcorp" matches "OldCorp". Set true when exact casing matters.false
Phrases: MatchEntireCellConditionalSet true to match only cells where the entire content equals SearchText. False (default) matches partial text within cells.false
Phrases: FormattingConditionalOptional object applying font changes to replaced text only: FontName, FontColor (hex), FontSize, Bold/Italic/Underline (Apply, Remove, or Inherit), StrikethroughType, ScriptType.{"Bold":"Apply","FontColor":"#003366"}

Output

FieldTypeWhat it contains
NameStringOutput Excel filename with extension.
Doc DataBufferThe updated Excel workbook as a binary buffer with all replacements applied across every worksheet. Pipe directly into a cloud storage upload, email attachment, or any downstream module.

How to Replace Text in Excel in Make

  1. Add PDF4me ExcelReplace Text to your Make scenario.
  2. Select Connection (or click Add to create one with your API key).
  3. Map File Name and Document from a prior cloud storage download or HTTP module.
  4. Click Add item under Phrases. Enter SearchText (the text to find) and ReplacementText (what to substitute, or leave empty to delete).
  5. Set optional flags: IsExpression for regex, CaseSensitive for exact casing, MatchEntireCell for whole-cell matching.
  6. Optionally expand Formatting to apply font color, bold, or other styling to replaced text only.
  7. Add more Phrases items for additional replacements (processed in order). Click Save and run. Map Doc Data from the output into an upload or email module.

When Should I Use Replace Text in Excel?

When Should I Use Replace Text in Excel?Common Make scenario patterns using Replace Text.
Standardize data entry errors weekly
  1. A scheduled trigger runs every Friday at 6 PM.
  2. Google Drive downloads the master data workbook.
  3. Replace Text runs with multiple Phrases: "California" to "CA", "Widget Type A" to "Widget-A", all with CaseSensitive false for flexible matching.
  4. The standardized workbook is uploaded back to Google Drive and the data team receives a completion email.
Rebrand company name across all Excel files
  1. A Dropbox Watch Folder triggers when a file is placed in the rebranding queue.
  2. Replace Text runs with SearchText "OldCorp Inc.", ReplacementText "NewCorp LLC", CaseSensitive true, and Formatting set to apply the new brand color (#003366) and Bold.
  3. All worksheets are processed in one call, ensuring no remaining references in hidden tabs.
  4. The rebranded workbook is saved to the output folder and the rebranding log is updated.
Normalize phone numbers with regex
  1. A scheduled trigger retrieves a customer data file from SharePoint.
  2. Replace Text runs with IsExpression true, SearchText set to a regex matching common phone formats, and ReplacementText using capture groups ($1, $2, $3) to output "(555) 123-4567" format.
  3. A second Phrases item corrects any remaining outliers using a simpler literal rule.
  4. The normalized workbook is uploaded for CRM import and a summary is sent to the data team.

Frequently Asked Questions

Does this module support regular expressions for text replacement in Excel?+
Yes. Set IsExpression to true in the Phrases array item and enter a regex pattern in SearchText. Use $1, $2 in ReplacementText to reference capture groups from the pattern. For example, a regex matching three groups of phone digits can reassemble them into (555) 123-4567 format. Phrases items are processed sequentially, so plan the order carefully if one replacement feeds into the next.
Can I replace text in specific worksheets only?+
No. The Replace Text module processes all worksheets in the workbook automatically. Every tab is included in a single pass. If you need worksheet-level control, pre-filter the workbook using another Excel module before passing it to Replace Text.
How do I delete text without replacing it with anything?+
Set ReplacementText to an empty string. The module removes the matched text from the cell and inserts nothing. This works for both literal and regex matches and applies across all worksheets.
Can I apply font formatting only to the text I replaced?+
Yes. Each Phrases array item accepts an optional Formatting object. Set FontColor to a hex value, Bold to Apply, and Italic to Apply or Inherit. The formatting applies only to the newly inserted ReplacementText, not to surrounding text in the same cell. This is useful for visually highlighting corrections or rebranded content.
Are multiple Phrases items processed in order?+
Yes. The module processes Phrases array items sequentially from first to last. If the replacement produced by item 1 matches the SearchText of item 2, item 2 will match that already-replaced content. Design the order with this chaining behavior in mind, especially when multiple patterns could overlap.

Get Help