Quote:
Originally Posted by Tye30
I think I mislead you in my last post.
|
Indeed. Try:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim StrTmp As String
With Selection
.Start = .Paragraphs.First.Range.Start
.End = .Paragraphs.First.Range.End - 1
StrTmp = Trim(Replace(Replace(.Text, "|Z|", "ZR"), "|", ""))
Do While InStr(StrTmp, " ") > 0
StrTmp = Replace(StrTmp, " ", " ")
Loop
.Text = StrTmp
End With
Application.ScreenUpdating = True
End Sub
With this code, it will process any paragraph you click in - you don't have to select the entire paragraph beforehand