G
gwh
Hi,
I found the following macro but it doesn't seem to run:
Public Sub RemoveTrailingSpacesAndFullStops()
Dim rCell As Range
Dim sTemp As String
On Error Resume Next 'in case none found
For Each rCell In Cells.SpecialCells( _
xlCellTypeConstants, xlTextValues)
sTemp = RTrim(rCell.Value)
If sTemp Like "*." Then _
sTemp = RTrim(Left(sTemp, Len(sTemp) - 1))
rCell.Value = sTemp
Next rCell
On Error GoTo 0
End Sub
I just pasted it into a new module but it appears red indicating a
syntax error and won't run. Can anyone tell me what might be wrong?
Thanks
I found the following macro but it doesn't seem to run:
Public Sub RemoveTrailingSpacesAndFullStops()
Dim rCell As Range
Dim sTemp As String
On Error Resume Next 'in case none found
For Each rCell In Cells.SpecialCells( _
xlCellTypeConstants, xlTextValues)
sTemp = RTrim(rCell.Value)
If sTemp Like "*." Then _
sTemp = RTrim(Left(sTemp, Len(sTemp) - 1))
rCell.Value = sTemp
Next rCell
On Error GoTo 0
End Sub
I just pasted it into a new module but it appears red indicating a
syntax error and won't run. Can anyone tell me what might be wrong?
Thanks