I already replied to one of your 5 posts about the same
thing. Did you read it, or do a little research on it?
Look at the extract function and see if you can make it so
instead of extracting letters as it is doing, you can make
it extract any other character instead. Also if you want
to go the more *difficult* way try and look for *arrays*
in vba (
http://msdn.microsoft.com/library/default.asp?
url=/library/en-
us/modcore/html/deconunderstandingarrays.asp)
------------------------------------------------------
What I'm thinking in your case, what
you might want to do is *extract* the characters that you
want from that string. If all you want are numbers and
letters of any case (upper or lower) then what you might
want to do is check what the ascii values are for letters
and numbers. example
Function fExtractStr(ByVal strInString As String) As String
Dim lngLen As Long, strOut As String
Dim i As Long, strTmp As String
lngLen = Len(strInString)
strOut = ""
For i = 1 To lngLen
strTmp = Left$(strInString, 1)
strInString = right$(strInString, lngLen - i)
'The next statement will extract BOTH Lower and Upper
case chars
If (Asc(strTmp) >= 65 And Asc(strTmp) <= 90) Or _
(Asc(strTmp) >= 97 And Asc(strTmp) <= 122) Then
'to extract just lower case, use the limit 97 -
122
'to extract just upper case, use the limit 65 -
90
strOut = strOut & strTmp
End If
Next i
fExtractStr = strOut
End Function
you can also accomplish the same thing by defining an array
() and inserting all the letters and numbers of the
alphabet in there, then grab your string and put it in a
loop and match each character from the string to that of
the array. Whenever a character from the string doesn't
match you get rid of it:
Replace(yourstringhere,charToReplace,"")
HTH