![]() |
#1
|
|||
|
|||
![]()
Hi
I have no idea where to start with this one ![]() I am looking to delete all text with the following criteria when in parenthesis some start with (formerly ) and some are (formerly John Wilson) with John Wilson being totally random could be any combination up to 25 characters End result - all deleted including parenthesis Any help greatly appreciated Thanks Steve The following works for (formerly ) as above but needing to catch (formerly John Wilson) << John Wilson could be anything random Sub replacetext() Dim test test = "(formerly )" Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = test .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll End Sub Last edited by NoLockdownsLOL; 07-14-2021 at 05:04 PM. |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Matt C | Word VBA | 7 | 05-30-2021 04:52 AM |
![]() |
LQuinn | Word VBA | 3 | 04-06-2021 04:51 PM |
![]() |
wrdy | Word | 2 | 08-03-2017 06:55 PM |
![]() |
Natedogg | Word | 2 | 05-21-2015 07:16 AM |
![]() |
fatso | Word | 2 | 08-04-2011 11:34 AM |