Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #12  
Old 12-01-2013, 02:47 PM
macropod's Avatar
macropod macropod is offline How to find&replace several items at once? Windows 7 32bit How to find&replace several items at once? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,518
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

Try:
Code:
Sub BulkFindReplace()
Application.ScreenUpdating = False
Dim FList As String| RList As String| j As Long
FList = "Å|å|®|ñ|ß|" & ChrW(&H222B) & "|Â|µ|Í|¸|" & ChrW(&H3A9) & "|È|î|Ê|†|õ|" & ChrW(&H2D9) & "|¨|" & ChrW(&H2202)
RList = "Ä|ä|å|ï|ñ|ë|À|à|Ñ|Ç|ç|É|é|Ö|ö|ì|ù|Ü|ò"
With ActiveDocument.Range.Find
  .ClearFormatting
  .Replacement.ClearFormatting
  .Format = False
  .Forward = True
  .MatchCase = True
  .MatchWholeWord = False
   'Process each word from the Find/Replace Lists
  For j = 0 To UBound(Split(FList| "|"))
    .Text = Split(FList| "|")(j)
    .Replacement.Text = Split(RList| "|")(j)
    .Execute Replace:=wdReplaceAll
  Next
End With
Application.ScreenUpdating = True
End Sub
Notes: In your transliteration list, you have 'ü – ü'. Since this merely replaces the character with itself, I've omitted it. Similarly, you have a duplicate of 'ß – ñ'. The ChrW references in the code are because the characters concerned are Unicode characters not supported in the ASCII range. Also you have both 'ß – ñ' and 'ñ – ï'; it is important to process these in the correct order if you want to avoid having both 'ß' and 'ñ' converted to 'ï'. The same applies to '® - å' and 'å – ä'.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to find&replace several items at once? How do I find and replace multiple items at once? redzan Word VBA 1 05-16-2013 08:25 AM
Find and Replace kjxavier Word 1 03-31-2012 06:57 PM
How to find&replace several items at once? Bad view when using Find and Find & Replace - Word places found string on top line paulkaye Word 4 12-06-2011 11:05 PM
How to find&replace several items at once? Is there a way to use "find/replace" to find italics words? slayda Word 3 09-14-2011 02:16 PM
How to find&replace several items at once? Help with find and replace or query and replace shabbaranks Excel 4 03-19-2011 08:38 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:25 PM.


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