<p>本人改编的人名汉字转换拼音的函数:</p><p>Function hztopy(hzpy As String) As String<br/> Dim hzstring As String, pystring As String<br/> Dim hzpysum As Integer, hzi As Integer, hzpyhex As Integer<br/> hzstring = Trim(hzpy)<br/> hzpysum = Len(Trim(hzstring))<br/> pystring = ""<br/> For hzi = 1 To hzpysum<br/> hzpyhex = "&H" + Hex(Asc(Mid(hzstring, hzi, 1)))<br/> Select Case hzpyhex<br/> Case &HB0A1 To &HB0C4: pystring = pystring + "A"<br/> Case &HB0C5 To &HB2C0: pystring = pystring + "B"<br/> Case &HB2C1 To &HB4ED: pystring = pystring + "C"<br/> Case &HB4EE To &HB6E9: pystring = pystring + "D"<br/> Case &HB6EA To &HB7A1: pystring = pystring + "E"<br/> Case &HB7A2 To &HB8C0: pystring = pystring + "F"<br/> Case &HB8C1 To &HB9FD: pystring = pystring + "G"<br/> Case &HB9FE To &HBBF6: pystring = pystring + "H"<br/> Case &HBBF7 To &HBFA5: pystring = pystring + "J"<br/> Case &HBFA6 To &HC0AB: pystring = pystring + "K"<br/> Case &HC0AC To &HC2E7: pystring = pystring + "L"<br/> Case &HC2E8 To &HC4C2: pystring = pystring + "M"<br/> Case &HC4C3 To &HC5B5: pystring = pystring + "N"<br/> Case &HC5B6 To &HC5BD: pystring = pystring + "O"<br/> Case &HC5BE To &HC6D9: pystring = pystring + "P"<br/> Case &HC6DA To &HC8BA: pystring = pystring + "Q"<br/> Case &HC8BB To &HC8F5: pystring = pystring + "R"<br/> Case &HC8F6 To &HCBF9: pystring = pystring + "S"<br/> Case &HCBFA To &HCDD9: pystring = pystring + "T"<br/> Case &HEDC5: pystring = pystring + "T"<br/> Case &HCDDA To &HCEF3: pystring = pystring + "W"<br/> Case &HCEF4 To &HD1B8: pystring = pystring + "X"<br/> Case &HD1B9 To &HD4D0: pystring = pystring + "Y"<br/> Case &HD4D1 To &HD7F9: pystring = pystring + "Z"<br/> Case Else<br/> pystring = pystring + Mid(hzstring, hzi, 1)<br/> End Select<br/> Next<br/> hztopy = pystring<br/>End Function<br/>以上代码直接拷贝到宏命令里,在单元格里,选“自定义”即可。</p><p></p>
SdaMGThU.rar
(8.28 KB, 下载次数: 283)
<br/>
[此贴子已经被作者于2008-1-24 17:51:15编辑过] |