Function StripText(InputText As String) As String
'Returns a string stripped of all non-alphabetic characters 'Example: This is a @$## Test!results in : This is a Test Dim intCurrentCharacter As Integer Dim strCurrentCharacter As String For intCurrentCharacter = 1 To Len(InputText) strCurrentCharacter = Mid(InputText, intCurrentCharacter, 1) If (Asc(strCurrentCharacter) > 64 And Asc(strCurrentCharacter) < 91) Or _ (Asc(strCurrentCharacter) > 96 And Asc(strCurrentCharacter) < 123) Then StripText = StripText & strCurrentCharacter End If Next intCurrentCharacter End Function |