Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 03-19-2023, 03:58 PM
Guessed's Avatar
Guessed Guessed is offline VBA help remove duplicates of blanks Windows 10 VBA help remove duplicates of blanks Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA help remove duplicates of blanks find/remove duplicates 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
VBA help remove duplicates of blanks Counting Blanks in 1 Column and Non-Blanks in Another 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

Other Forums: Access Forums

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