噢,想起上次有一个取拼音开头的Excel宏函数- Option Explicit
- Public Function LChin(Str As String) As Variant
- On Error Resume Next
- Str = StrConv(Str, vbNarrow)
- If Asc(Str) > 0 Or Err.Number = 1004 Then LChin = ""
- LChin = WorksheetFunction.VLookup(Str, [{"吖","a";"八","b";"嚓","c";"咑","d";"鵽","e";"发","f";"猤","g";"铪","h";"夻","j";"咔","k";"垃","l";"嘸","m";"旀","n";"噢","o";"妑","p";"七","q";"囕","r";"仨","s";"他","t";"屲","w";"夕","x";"丫","y";"帀","z"}], 2)
- End Function
复制代码
|