Quote:
Originally Posted by Shmuel G
This technique destroys any character formatting within the selection, such as change of fonts. Is there a simple way to replace the text of the range with the new version, while preserving the original formatting?
|
It seems that replacing the .Text of each of the Characters in a range, one at a time, will preserve the formatting, but that requires the replacement string to be the same length as the original string.
If not for the trimming and replacement of double spaces, formatting could be preserved by replacing
with
Code:
Dim i As Long
For i = 1 To .Characters.Count
.Characters(i).Text = Mid$(StrTmp, i, 1)
Next