![]() |
|
#1
|
||||
|
||||
![]() This modification appears to get all of them apart from the ones separated by a space. Do you want those as well? Code:
Sub DeleteCoding() Dim Rng As Range 'Application.ScreenUpdating = False Set Rng = Selection.Range With Rng.Find .ClearFormatting .Replacement.ClearFormatting .Forward = True .Wrap = wdFindContinue .Format = False .MatchWildcards = True .Text = "[\{]{1,}[!\}]@[\}]{1,}" 'find text within curly braces and replace with square bracket blank .Replacement.Text = "[" & ChrW(9679) & "]" .Execute Replace:=wdReplaceAll .Text = "[\[" & ChrW(9679) & "\]]{4,}" .Execute Replace:=wdReplaceAll .MatchWildcards = False .Text = "<" 'remove all instances of less than symbol .Replacement.Text = "" .Execute Replace:=wdReplaceAll .Text = ">" 'remove all instances of greater than sumbol .Replacement.Text = "" .Execute Replace:=wdReplaceAll .Format = False .Font.Superscript = True 'remove superscript wording .Text = "" .Replacement.Text = "" .Execute Replace:=wdReplaceAll End With 'Application.ScreenUpdating = True End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#2
|
|||
|
|||
![]()
Hi Andrew, thank you for replying - I added your extra bit of code and I think it has removed a few of the duplicates but many still remain - with regard to your query re separated by spaces, yes that would be great if those could be included also.
Code:
.text = "[\[" & ChrW(9679) & "\]]{4,}" .Execute Replace:=wdReplaceAll Capture 2.JPG |
#3
|
|||
|
|||
![]()
Hi Andrew, I wondered if you had had a chance to look at the code, no worries if not, I have been doing a lot of research online but there isn't much out there relating to duplicates in Word, lots for excel but not a lot for Word. thanks again.
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
hephalumph | Word | 9 | 02-06-2022 07:23 PM |
look for VBA to remove Duplicates from Subfolders | nf24eg | Outlook | 0 | 08-12-2021 05:03 AM |
Macro to keep first instance and remove duplicates in certain column | zhead | Excel | 2 | 03-18-2015 10:16 AM |
![]() |
dogwood705 | Excel | 4 | 02-07-2015 08:45 AM |
Macro to remove duplicates in Refrences list | HowardC | Word VBA | 0 | 05-20-2010 09:57 AM |