View Single Post
 
Old 03-19-2023, 03:58 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,166
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Try this version
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 = 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
    .MatchWildcards = True
    .ClearFormatting
    .Text = "[\{]{1,}[!\}]@[\}]{1,}" 'find text within curly braces and replace with square bracket blank
    .Replacement.Text = "[" & ChrW(9679) & "]"
    .Execute Replace:=wdReplaceAll
    .MatchWildcards = False
    .Text = "]^w["                    'remove spaces between ][
    .Replacement.Text = "]["
    .Execute Replace:=wdReplaceAll
    .MatchWildcards = True
    .Text = "[\[" & ChrW(9679) & "\]]{4,}"
    .Replacement.Text = "[" & ChrW(9679) & "]"
    .Execute Replace:=wdReplaceAll
  End With
  'Application.ScreenUpdating = True
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote