标签:
---恢复内容开始---
1.启动Excel 2003(其它版本请仿照操作),打开相应的工作表;
2.执行“工具→宏→Visual Basic编辑器”命令(或者直接按“Alt+F11”组合键),进入Visual Basic编辑状态;
3.执行“插入→模块”命令,插入一个新模块。再双击插入的模块,进入模块代码编辑状态;
Function pinyin(p As String) As String
i = Asc(p)
Select Case i
Case -20319 To -20318: pinyin = "a "
Case -20317 To -20305: pinyin = "ai "
Case -20304 To -20296: pinyin = "an "
Case -20295 To -20293: pinyin = "ang "
Case -20292 To -20284: pinyin = "ao "
Case -20283 To -20266: pinyin = "ba "
Case -20265 To -20258: pinyin = "bai "
Case -20257 To -20243: pinyin = "ban "
Case -20242 To -20231: pinyin = "bang "
Case -20230 To -20052: pinyin = "bao "
Case -20051 To -20037: pinyin = "bei "
Case -20036 To -20033: pinyin = "ben "
Case -20032 To -20027: pinyin = "beng "
Case -20026 To -20003: pinyin = "bi "
Case -20002 To -19991: pinyin = "bian "
Case -19990 To -19987: pinyin = "biao "
Case -19986 To -19983: pinyin = "bie "
Case -19982 To -19977: pinyin = "bin "
Case -19976 To -19806: pinyin = "bing "
Case -19805 To -19785: pinyin = "bo "
Case -19784 To -19776: pinyin = "bu "
Case -19775 To -19775: pinyin = "ca "
Case -19774 To -19764: pinyin = "cai "
Case -19763 To -19757: pinyin = "can "
Case -19756 To -19752: pinyin = "cang "
Case -19751 To -19747: pinyin = "cao "
Case -19746 To -19742: pinyin = "ce "
Case -19741 To -19740: pinyin = "ceng "
Case -19739 To -19729: pinyin = "cha "
Case -19728