View Single Post
 
Old 02-23-2012, 05:42 AM
JBeaucaire JBeaucaire is offline Windows XP Office 2003
Advanced Beginner
 
Join Date: Dec 2011
Posts: 51
JBeaucaire is on a distinguished road
Default

Put this new FUNCTION into a standard code module:

Code:
Option Explicit

Function CleanText(ByVal Txt As String) As String
Dim X As Long     'Code base by Rick Rothstein (MVP - Excel)
    For X = 1 To Len(Txt)
        If Mid(Txt, X, 1) Like "*[!A-Za-z]*" Then Mid(Txt, X, 1) = Chr(1) ' Leave only letters
    Next
    CleanText = Replace(Txt, Chr(1), "")
End Function
Now, use this as a formula. Your strings are in column A, in B1 enter:

=CLEANTEXT(A1)

...and copy down.
Reply With Quote