View Single Post
 
Old 01-08-2016, 06:11 AM
mackeex mackeex is offline Windows 10 Office 2016
Novice
 
Join Date: Jan 2016
Posts: 2
mackeex is on a distinguished road
Default Locate ALL CAPS in a paragraph

Hi to all!

I have this macro:

Sub DeleteCap3Word()
With Selection.Find
.ClearFormatting
.Text = " ([A-Z][A-Z][A-Z]) "
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = True
.MatchWholeWord = True
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute
While .Found
Selection.Find.Execute Replace:=wdReplaceAll
Wend
End With
End Sub

My problem is that it looks for all 3-letter words in all caps including those that I need (ex. MRI, PSA, USB, etc.).

Is there a way to have exceptions so that certain acronyms which I need is not deleted and only 3-letter all caps word which needs to be deleted?

Thank you in advance for your help!!!
Reply With Quote