Hi Hcoms,
simple in some ways, complicated in others ways.
First I think, that you wouldn't like to remove an "," or an "("
etc. from your string. Control characters are usually in the range
from 0 to 31. Though nothing would prevent a programmer
to trigger an action, as soon as the first figure is found.
In that case the figure could be non displayable. ;-)
The first visible character is the invisible space (32).
From your postings on tables I think, you would like to get rid of
cell-end-marks and so on:
Function PurgeString(OldStr As String) As String
Dim NewStr As String
Dim l As Long
For l = 1 To Len(OldStr)
If Asc(Mid(OldStr, l, 1)) > 31 Then
NewStr = NewStr & Mid(OldStr, l, 1)
End If
Next
PurgeString = NewStr
End Function
---
Sub test445()
MsgBox PurgeString(Selection.Text)
End Sub
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98