![]() |
|
#1
|
|||
|
|||
|
Hi there,
For certain documents I'm using this code to make automatisch Search + Replace, but the code is getting very long. Is there a way to combine, strip or trim this code, as most of it is the same for every change? In that case I will have a better view of what I'm doing, instead of a code with 2000+ rules. Thank you for your time. Yolanda Sub Ams1() ' ' Ams1 Macro ' ' Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = " " .Replacement.Text = " " .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = " " .Replacement.Text = " " .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End Sub |
| Tags |
| code, replace, search |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Need some vba code to search a word document an replace it if len = 3
|
Belleke | Word VBA | 3 | 10-24-2016 01:00 AM |
| Search Replace Code | BolligeA1 | Word | 8 | 02-22-2016 12:32 PM |
Need code to combine PDF files.
|
D1TrueGod | Word VBA | 4 | 08-15-2015 06:15 AM |
| Search and replace/insert HTML code into Master File using tags | dave8555 | Excel | 2 | 02-23-2014 03:51 PM |
Please help me to combine these code together
|
lbf200n | Word VBA | 3 | 12-09-2012 04:22 PM |