'判断字符是否为a-z,A-Z,0-9中的一个
Function ChrCompare(chr As String) As Boolean
    If chr Like "[a-z]" Or _
       chr Like "[A-Z]" Or _
       chr Like "[0-9]" Then
        ChrCompare = True
    Else
        ChrCompare = False
    End If
End Function

'提取字符串中的英语和数字
Function GetStr(str As String) As String
    Dim i As Integer
    Dim s As String
    GetStr = ""
    For i = 1 To Len(str)
        s = Mid(str, i, 1)
        If ChrCompare(s) Then
            GetStr = GetStr & s
        End If
    Next
End Function