Trim trailing space macro stopped working
Hi everyone
Resolved.
This is an old macro that just removes the trailing space for text (quick clean up). But it is not working Windows 10 Office 365 Business Standard.
A
Rny ideas how to make it work? - It doesn't error it just doesn't remove the trailing space in the Word document.
Sub Purge_Trailing_Space()
Dim s As String
On Error Resume Next
With ActiveDocument
If Len(.Range) = 1 Then Exit Sub
s = .Characters.Last.Previous
While s = " " Or s = Chr(13) Or s = Chr(11)
.Characters.Last.Previous = ""
s = .Characters.Last.Previous
Wend
End With
End Sub
Janine
Last edited by jec1; 08-01-2021 at 03:15 PM.
|