Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-02-2021, 05:02 AM
macropod's Avatar
macropod macropod is offline Find word and replace tab with two spaces Windows 10 Find word and replace tab with two spaces Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,521
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

This works for me:
Code:
Sub CleanUp()
With ActiveDocument.Range.Find
  .ClearFormatting
  .Text = "([MR][EI][PS][ST][AU][GR]E:)[^t^s ]@<"
  .Replacement.Text = "\1  "
  .Replacement.ParagraphFormat.LeftIndent = 0
  .Format = True
  .Forward = True
  .Wrap = wdFindContinue
  .MatchWildcards = True
  .Execute Replace:=wdReplaceAll
End With
End Sub

__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find word and replace tab with two spaces Find and replace query re missing spaces Johanna Word 3 11-22-2019 01:06 AM
Find word and replace tab with two spaces How to find and replace random empty spaces in beginning of lines? Pauliina Word 4 05-24-2018 10:01 PM
Find word and replace tab with two spaces Macro to find and replace specific types of spaces dita Word VBA 7 05-06-2018 12:47 AM
Find word and replace tab with two spaces Find and Replace/Insert 'CR', delete leading Spaces wherever a user Clicks in a Word document DavidL Word VBA 7 04-04-2018 12:01 AM
Find word and replace tab with two spaces Find and replace mutiple spaces between lowercase words only Dave T Word VBA 2 07-16-2015 11:23 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:05 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft