View Single Post
 
Old 09-23-2023, 07:25 AM
vivka vivka is offline Windows 7 64bit Office 2016
Expert
 
Join Date: Jul 2023
Posts: 302
vivka is on a distinguished road
Default

Hi, if I correctly understand your objective, try this (move quotes to be just before the punctuations):
For Each myChr In myRng.Characters
If myChr Like "[,;.:?]" _
And myChr.Next Like "[«‹›»" & Chr(39) & Chr(34) & Chr(146) & Chr(148) & "]" Then
myChr.InsertBefore myChr.Next
myChr.Next.Delete
End If


Note that the code is quite slow because it checks each char in the range.
Reply With Quote