Private Function GetPYChar(a1 As String) As String Dim t1 As String If Asc(a1) < 0 Then t1 = Left(a1, 1) If Asc(t1) < Asc("啊") Then GetPYChar = " " Exit Function End If If Asc(t1) >= Asc("啊") And Asc(t1) < Asc("芭") Then GetPYChar = "A" Exit Function End If If Asc(t1) >= Asc("芭") And Asc(t1) < Asc("擦") Then GetPYChar = "B" Exit Function End If If Asc(t1) >= Asc("擦") And Asc(t1) < Asc("搭") Then GetPYChar = "C" Exit Function End If If Asc(t1) >= Asc("搭") And Asc(t1) < Asc("蛾") Then GetPYChar = "D" Exit Function End If If Asc(t1) >= Asc("蛾") And Asc(t1) < Asc("发") Then GetPYChar = "E" Exit Function End If If Asc(t1) >= Asc("发") And Asc(t1) < Asc("噶") Then GetPYChar = "F" Exit Function End If If Asc(t1) >= Asc("噶") And Asc(t1) < Asc("哈") Then GetPYChar = "G" Exit Function End If If Asc(t1) >= Asc("哈") And Asc(t1) < Asc("击") Then GetPYChar = "H" Exit Function End If If Asc(t1) >= Asc("击") And Asc(t1) < Asc("喀") Then GetPYChar = "J" Exit Function End If If Asc(t1) >= Asc("喀") And Asc(t1) < Asc("垃") Then GetPYChar = "K" Exit Function End If If Asc(t1) >= Asc("垃") And Asc(t1) < Asc("妈") Then GetPYChar = "L" Exit Function End If If Asc(t1) >= Asc("妈") And Asc(t1) < Asc("拿") Then GetPYChar = "M" Exit Function End If If Asc(t1) >= Asc("拿") And Asc(t1) < Asc("哦") Then GetPYChar = "N" Exit Function End If If Asc(t1) >= Asc("哦") And Asc(t1) < Asc("啪") Then GetPYChar = "O" Exit Function End If If Asc(t1) >= Asc("啪") And Asc(t1) < Asc("期") Then GetPYChar = "P" Exit Function End If If Asc(t1) >= Asc("期") And Asc(t1) < Asc("然") Then GetPYChar = "Q" Exit Function End If If Asc(t1) >= Asc("然") And Asc(t1) < Asc("撒") Then GetPYChar = "R" Exit Function End If If Asc(t1) >= Asc("撒") And Asc(t1) < Asc("塌") Then GetPYChar = "S" Exit Function End If If Asc(t1) >= Asc("塌") And Asc(t1) < Asc("挖") Then GetPYChar = "T" Exit Function End If If Asc(t1) >= Asc("挖") And Asc(t1) < Asc("昔") Then GetPYChar = "W" Exit Function End If If Asc(t1) >= Asc("昔") And Asc(t1) < Asc("压") Then GetPYChar = "X" Exit Function End If If Asc(t1) >= Asc("压") And Asc(t1) < Asc("匝") Then GetPYChar = "Y" Exit Function End If If Asc(t1) >= Asc("匝") Then GetPYChar = "Z" Exit Function End If Else If UCase(a1) <= "Z" And UCase(a1) >= "A" Then GetPYChar = UCase(Left(a1, 1)) Else GetPYChar = " " End If End If End Function
Dim t1 As String
If Asc(a1) < 0 Then
t1 = Left(a1, 1)
If Asc(t1) < Asc("啊") Then
GetPYChar = " "
Exit Function
End If
If Asc(t1) >= Asc("啊") And Asc(t1) < Asc("芭") Then
GetPYChar = "A"
Exit Function
End If
If Asc(t1) >= Asc("芭") And Asc(t1) < Asc("擦") Then
GetPYChar = "B"
Exit Function
End If
If Asc(t1) >= Asc("擦") And Asc(t1) < Asc("搭") Then
GetPYChar = "C"
Exit Function
End If
If Asc(t1) >= Asc("搭") And Asc(t1) < Asc("蛾") Then
GetPYChar = "D"
Exit Function
End If
If Asc(t1) >= Asc("蛾") And Asc(t1) < Asc("发") Then
GetPYChar = "E"
Exit Function
End If
If Asc(t1) >= Asc("发") And Asc(t1) < Asc("噶") Then
GetPYChar = "F"
Exit Function
End If
If Asc(t1) >= Asc("噶") And Asc(t1) < Asc("哈") Then
GetPYChar = "G"
Exit Function
End If
If Asc(t1) >= Asc("哈") And Asc(t1) < Asc("击") Then
GetPYChar = "H"
Exit Function
End If
If Asc(t1) >= Asc("击") And Asc(t1) < Asc("喀") Then
GetPYChar = "J"
Exit Function
End If
If Asc(t1) >= Asc("喀") And Asc(t1) < Asc("垃") Then
GetPYChar = "K"
Exit Function
End If
If Asc(t1) >= Asc("垃") And Asc(t1) < Asc("妈") Then
GetPYChar = "L"
Exit Function
End If
If Asc(t1) >= Asc("妈") And Asc(t1) < Asc("拿") Then
GetPYChar = "M"
Exit Function
End If
If Asc(t1) >= Asc("拿") And Asc(t1) < Asc("哦") Then
GetPYChar = "N"
Exit Function
End If
If Asc(t1) >= Asc("哦") And Asc(t1) < Asc("啪") Then
GetPYChar = "O"
Exit Function
End If
If Asc(t1) >= Asc("啪") And Asc(t1) < Asc("期") Then
GetPYChar = "P"
Exit Function
End If
If Asc(t1) >= Asc("期") And Asc(t1) < Asc("然") Then
GetPYChar = "Q"
Exit Function
End If
If Asc(t1) >= Asc("然") And Asc(t1) < Asc("撒") Then
GetPYChar = "R"
Exit Function
End If
If Asc(t1) >= Asc("撒") And Asc(t1) < Asc("塌") Then
GetPYChar = "S"
Exit Function
End If
If Asc(t1) >= Asc("塌") And Asc(t1) < Asc("挖") Then
GetPYChar = "T"
Exit Function
End If
If Asc(t1) >= Asc("挖") And Asc(t1) < Asc("昔") Then
GetPYChar = "W"
Exit Function
End If
If Asc(t1) >= Asc("昔") And Asc(t1) < Asc("压") Then
GetPYChar = "X"
Exit Function
End If
If Asc(t1) >= Asc("压") And Asc(t1) < Asc("匝") Then
GetPYChar = "Y"
Exit Function
End If
If Asc(t1) >= Asc("匝") Then
GetPYChar = "Z"
Exit Function
End If
Else
If UCase(a1) <= "Z" And UCase(a1) >= "A" Then
GetPYChar = UCase(Left(a1, 1))
Else
GetPYChar = " "
End If
End If
End Function