Crystal and Graham,
Thanks very much both of you. Both methods work for me. Appreciate the advice.
Steve
hi Steve,
here is a function to return letters and digits:
'~~~~~~~~~~~~~~~~~~~
Function GetLettersDigits(psString As String) As String
'180525 strive4peace
'PARAMETERS
' psString is the string with information to extract
Dim sResult As String _
, i As Integer _
, sChar As String * 1
sResult = ""
'loop through and only keep letters and digits
For i = 1 To Len(psString)
sChar = Mid(psString, i, 1)
If sChar Like "[0-9,A-Z]" Then
sResult = sResult & sChar
End If
Next i
GetLettersDigits = sResult
End Function
'~~~~~~~~~~~~~~~~~~~
have an awesome day,
crystal
On 5/25/18 4:11 PM, Steve thaw5 thaw5@suddenlink.net
[MS_Access_Professionals] wrote:
> In the snippet of code below, CombinedInfo is a string containing upper
> and lower case letters, numbers, spaces and assorted special characters
> such as &, *, $, #, @, etc. I need to delete the spaces and special
> characters, retaining only the letters (upper and lower case) and
> numbers. What type of test can I use in the For-Next loop to do that?
>
> For MyCounter = 1 To Len(CombinedInfo)
> Debug.Print MyCounter & " " & Mid(CombinedInfo, MyCounter, 1)
> Next MyCounter
>
> Thanks, Steve
>
>
> ------------------------------------
> Posted by: Steve thaw5 <thaw5@suddenlink.net>
> ------------------------------------
>
>
> ------------------------------------
>
> Yahoo Groups Links
>
>
>
Posted by: Steve thaw5 <thaw5@suddenlink.net>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (4) |
Tidak ada komentar:
Posting Komentar