![]() |
#3
|
|||
|
|||
![]() Code:
Sub EmDash() Dim rngStory As Range For Each rngStory In ActiveDocument.StoryRanges Dim MyList() As String Dim i As Long Options.DefaultHighlightColorIndex = wdTurquoise MyList = Split("—,[ ]{1,}—[ ]{1,}") For i = 0 To UBound(MyList()) Set r = ActiveDocument.Range With rngStory.Find .Text = MyList(i) .Replacement.Text = "^32—^32" .MatchWildcards = True .MatchCase = True .Replacement.Highlight = wdTurquoise .Execute Replace:=wdReplaceAll End With Next Next End Sub Last edited by macropod; 05-29-2022 at 06:57 AM. Reason: Added code tags |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
alex100 | Word VBA | 2 | 05-04-2020 11:19 PM |
Find % change from last month automatically updated | GraemeSS | Excel | 7 | 04-03-2020 02:50 AM |
Loop through all shapes in all stories not working | Peterson | Word VBA | 5 | 03-04-2018 11:02 AM |
![]() |
Cosmo | Word | 1 | 06-19-2014 01:09 PM |
![]() |
Ssendam | Excel | 1 | 07-16-2009 11:44 AM |