Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-05-2018, 02:34 AM
bertietheblue bertietheblue is offline Searching for any instances of immediate word repetition (eg "the the") Windows 7 64bit Searching for any instances of immediate word repetition (eg "the the") Office 2010 32bit
Advanced Beginner
Searching for any instances of immediate word repetition (eg "the the")
 
Join Date: May 2012
Location: United Kingdom
Posts: 54
bertietheblue is on a distinguished road
Default Searching for any instances of immediate word repetition (eg "the the")

Is there a macro that will allow me to search a Word document for any instances where the same word (including singular/plural number agreement and initial case) is immediately repeated without separation by punctuation, eg:

"the the"



"services services"

but not:

"the, the"

"services Service"

?

Many thanks.
Reply With Quote
  #2  
Old 02-05-2018, 05:06 AM
gmayor's Avatar
gmayor gmayor is offline Searching for any instances of immediate word repetition (eg "the the") Windows 10 Searching for any instances of immediate word repetition (eg "the the") Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,142
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

You don't really need a macro. Do a wildcard search for
(<[a-zA-Z]{2,}>) \1
replace with
\1

http://www.gmayor.com/replace_using_wildcards.htm
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 02-05-2018, 05:28 AM
bertietheblue bertietheblue is offline Searching for any instances of immediate word repetition (eg &quot;the the&quot;) Windows 7 64bit Searching for any instances of immediate word repetition (eg &quot;the the&quot;) Office 2010 32bit
Advanced Beginner
Searching for any instances of immediate word repetition (eg &quot;the the&quot;)
 
Join Date: May 2012
Location: United Kingdom
Posts: 54
bertietheblue is on a distinguished road
Default

Thanks a lot, this is great! But is an adjustment possible to make the wild-card search whole-word-only? For example, it picks up:
"or oral"
"or order"

but I just want it to pick up instances of
"or or"
Reply With Quote
  #4  
Old 02-05-2018, 01:04 PM
macropod's Avatar
macropod macropod is offline Searching for any instances of immediate word repetition (eg &quot;the the&quot;) Windows 7 64bit Searching for any instances of immediate word repetition (eg &quot;the the&quot;) Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

Use a wildcard Find/Replace with:
Find = (<[A-Za-z]@>) <\1>
Replace = \1
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 02-05-2018, 02:42 PM
bertietheblue bertietheblue is offline Searching for any instances of immediate word repetition (eg &quot;the the&quot;) Windows 7 64bit Searching for any instances of immediate word repetition (eg &quot;the the&quot;) Office 2010 32bit
Advanced Beginner
Searching for any instances of immediate word repetition (eg &quot;the the&quot;)
 
Join Date: May 2012
Location: United Kingdom
Posts: 54
bertietheblue is on a distinguished road
Smile

Magic! Thanks
Reply With Quote
  #6  
Old 02-05-2018, 06:29 PM
JML's Avatar
JML JML is offline Searching for any instances of immediate word repetition (eg &quot;the the&quot;) Mac OS X Searching for any instances of immediate word repetition (eg &quot;the the&quot;) Office 2016 for Mac
Novice
 
Join Date: Feb 2018
Location: Pittsburgh, PA
Posts: 5
JML is on a distinguished road
Default

The spelling and grammar check can reveal doubled instances like that. There's an option to choose for repeated words.
Reply With Quote
  #7  
Old 02-05-2018, 06:30 PM
macropod's Avatar
macropod macropod is offline Searching for any instances of immediate word repetition (eg &quot;the the&quot;) Windows 7 64bit Searching for any instances of immediate word repetition (eg &quot;the the&quot;) Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

Yes, but it does so on a case-by case basis; the Find/Replace does the lot in one go.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I delete the names under "Exceptions" when I use the "Restrict Editing" feature in Word? MengS Word 0 02-25-2015 02:57 PM
Searching for any instances of immediate word repetition (eg &quot;the the&quot;) Word 2011 Mac: autoconvert "2015" to "two thousand and fifteen?" moonman239 Word 3 02-06-2015 12:22 PM
can find and replace instances of the "enter" key? snunicycler Word 7 05-02-2013 11:54 PM
Searching for any instances of immediate word repetition (eg &quot;the the&quot;) Word options "field shading" reverts to "when selected" PaulBurcham Word 1 04-20-2013 11:18 AM
'Linking' entered information to other "cells" from an original "cell" in MS Word Wade Word 6 09-03-2012 05:22 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:29 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