利用Excel函数将汉字姓名快速转拼音技巧
Excel将汉字转拼音技巧你会吗?
Excel将汉字转拼⾳技巧你会吗?
厉害了,word哥,汉字提取拼⾳
如何将下列的汉字拼⾳在Excel中?
英雄
吕布
⼩乔
⼤乔
程咬⾦
钟馗
1将拼⾳显⽰出来
将表格中的数据复制,然后新建⼀个word⽂档中
ctrl+v将复制的值粘贴
ctrl+a选中所有数据,点击字体字号旁边的“⽂”标志符号,出现下⽅的拼⾳指南
直接点击确定,然后所有的⽂字上⽅便出现了拼⾳符号
2带拼⾳字符保存在Excel数据中
将word中的数据全选,复制粘贴回Excel⽂档中
在B列数据上⽅可以看到汉字上⽅已经带有拼⾳字符了
3使⽤PHONETIC函数提取拼⾳字符
函数太复杂,记不住没关系
在C列使⽤输⼊公式=ph,EXCEL会⾃动联想公式
=PHONETIC(B1),向下填充,得到所有的结果
这样就将所有的汉字拼⾳提取出来了!
这下总不会将钟馗读成zhongdao了~~
===========================
同步原创微信公众号:⾃学成才Excel(ID:selftt)
关注回复Excel有惊喜!
本⽂为头条号作者发布,不代表今⽇头条⽴场。
如何在excel中把汉字转换成拼音
Excel自定义函数方法:1.启动Excel 2003(其它版本请仿照操作),打开相应的工作表;2.执行“工具→宏→Visual Basic编辑器”命令(或者直接按“Alt+F11”组合键),进入Visual Basic编辑状态;3.执行“插入→模块”命令,插入一个新模块。
再双击插入的模块,进入模块代码编辑状态;4.将代码输入其中;5.代码输入完成后,关闭Visual Basic编辑窗口,返回Excel编辑状态;6.自定义函数就可以用了,如:选中D2单元格,输入公式:=getpy(A2)。
有极个别的汉字不能转换,手动就可以了!很方便了。
Function pinyin(p As String) As Stringi = Asc(p)Select Case iCase -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 To -19726: pinyin = "chai "Case -19715 To -19541: pinyin = "chang " Case -19540 To -19532: pinyin = "chao " Case -19531 To -19526: pinyin = "che " Case -19525 To -19516: pinyin = "chen " Case -19515 To -19501: pinyin = "cheng " Case -19500 To -19485: pinyin = "chi " Case -19484 To -19480: pinyin = "chong " Case -19479 To -19468: pinyin = "chou " Case -19467 To -19290: pinyin = "chu " Case -19289 To -19289: pinyin = "chuai " Case -19288 To -19282: pinyin = "chuan " Case -19281 To -19276: pinyin = "chuang " Case -19275 To -19271: pinyin = "chui " Case -19270 To -19264: pinyin = "chun " Case -19263 To -19262: pinyin = "chuo " Case -19261 To -19250: pinyin = "ci " Case -19249 To -19244: pinyin = "cong " Case -19243 To -19243: pinyin = "cou " Case -19242 To -19239: pinyin = "cu " Case -19238 To -19236: pinyin = "cuan " Case -19235 To -19228: pinyin = "cui " Case -19227 To -19225: pinyin = "cun " Case -19224 To -19219: pinyin = "cuo " Case -19218 To -19213: pinyin = "da " Case -19212 To -19039: pinyin = "dai " Case -19038 To -19024: pinyin = "dan " Case -19023 To -19019: pinyin = "dang " Case -19018 To -19007: pinyin = "dao " Case -19006 To -19004: pinyin = "de " Case -19003 To -18997: pinyin = "deng " Case -18996 To -18978: pinyin = "di " Case -18977 To -18962: pinyin = "dian " Case -18961 To -18953: pinyin = "diao " Case -18952 To -18784: pinyin = "die " Case -18783 To -18775: pinyin = "ding " Case -18774 To -18774: pinyin = "diu " Case -18773 To -18527: pinyin = "dong " Case -18526 To -18519: pinyin = "fa " Case -18518 To -18502: pinyin = "fan " Case -18501 To -18491: pinyin = "fang " Case -18490 To -18479: pinyin = "fei " Case -18478 To -18464: pinyin = "fen " Case -18463 To -18449: pinyin = "feng "Case -18447 To -18447: pinyin = "fou " Case -18446 To -18240: pinyin = "fu " Case -18239 To -18238: pinyin = "ga " Case -18237 To -18232: pinyin = "gai " Case -18231 To -18221: pinyin = "gan " Case -18220 To -18212: pinyin = "gang " Case -18211 To -18202: pinyin = "gao " Case -18201 To -18185: pinyin = "ge " Case -18184 To -18184: pinyin = "gei " Case -18183 To -18182: pinyin = "gen " Case -18181 To -18013: pinyin = "geng " Case -18012 To -17998: pinyin = "gong " Case -17997 To -17989: pinyin = "gou " Case -17988 To -17971: pinyin = "gu " Case -17970 To -17965: pinyin = "gua " Case -17964 To -17962: pinyin = "guai " Case -17961 To -17951: pinyin = "guan " Case -17950 To -17948: pinyin = "guang " Case -17947 To -17932: pinyin = "gui " Case -17931 To -17929: pinyin = "gun " Case -17928 To -17923: pinyin = "guo " Case -17922 To -17760: pinyin = "ha " Case -17759 To -17753: pinyin = "hai " Case -17752 To -17734: pinyin = "han " Case -17733 To -17731: pinyin = "hang " Case -17730 To -17722: pinyin = "hao " Case -17721 To -17704: pinyin = "he " Case -17703 To -17702: pinyin = "hei " Case -17701 To -17698: pinyin = "hen " Case -17697 To -17693: pinyin = "heng " Case -17692 To -17684: pinyin = "hong " Case -17683 To -17677: pinyin = "hou " Case -17676 To -17497: pinyin = "hu " Case -17496 To -17488: pinyin = "hua " Case -17487 To -17483: pinyin = "huai " Case -17482 To -17469: pinyin = "huan " Case -17468 To -17455: pinyin = "huang " Case -17454 To -17434: pinyin = "hui " Case -17433 To -17428: pinyin = "hun " Case -17427 To -17418: pinyin = "huo " Case -17417 To -17203: pinyin = "ji " Case -17202 To -17186: pinyin = "jia " Case -17185 To -16984: pinyin = "jian "Case -16970 To -16943: pinyin = "jiao " Case -16942 To -16916: pinyin = "jie " Case -16915 To -16734: pinyin = "jin " Case -16733 To -16709: pinyin = "jing " Case -16708 To -16707: pinyin = "jiong " Case -16706 To -16690: pinyin = "jiu " Case -16689 To -16665: pinyin = "ju " Case -16664 To -16658: pinyin = "juan " Case -16657 To -16648: pinyin = "jue " Case -16647 To -16475: pinyin = "jun " Case -16474 To -16471: pinyin = "ka " Case -16470 To -16466: pinyin = "kai " Case -16465 To -16460: pinyin = "kan " Case -16459 To -16453: pinyin = "kang " Case -16452 To -16449: pinyin = "kao " Case -16448 To -16434: pinyin = "ke " Case -16433 To -16430: pinyin = "ken " Case -16429 To -16428: pinyin = "keng " Case -16427 To -16424: pinyin = "kong " Case -16423 To -16420: pinyin = "kou " Case -16419 To -16413: pinyin = "ku " Case -16412 To -16408: pinyin = "kua " Case -16407 To -16404: pinyin = "kuai " Case -16403 To -16402: pinyin = "kuan " Case -16401 To -16394: pinyin = "kuang " Case -16393 To -16221: pinyin = "kui " Case -16220 To -16217: pinyin = "kun " Case -16216 To -16213: pinyin = "kuo " Case -16212 To -16206: pinyin = "la " Case -16205 To -16203: pinyin = "lai " Case -16202 To -16188: pinyin = "lan " Case -16187 To -16181: pinyin = "lang " Case -16180 To -16172: pinyin = "lao " Case -16171 To -16170: pinyin = "le " Case -16169 To -16159: pinyin = "lei " Case -16158 To -16156: pinyin = "leng " Case -16155 To -15960: pinyin = "li " Case -15959 To -15959: pinyin = "lia " Case -15958 To -15945: pinyin = "lian " Case -15944 To -15934: pinyin = "liang " Case -15933 To -15921: pinyin = "liao " Case -15920 To -15916: pinyin = "lie " Case -15915 To -15904: pinyin = "lin "Case -15889 To -15879: pinyin = "liu " Case -15878 To -15708: pinyin = "long " Case -15707 To -15702: pinyin = "lou " Case -15701 To -15682: pinyin = "lu " Case -15681 To -15668: pinyin = "lv " Case -15667 To -15662: pinyin = "luan " Case -15661 To -15660: pinyin = "lue " Case -15659 To -15653: pinyin = "lun " Case -15652 To -15641: pinyin = "luo " Case -15640 To -15632: pinyin = "ma " Case -15631 To -15626: pinyin = "mai " Case -15625 To -15455: pinyin = "man " Case -15454 To -15449: pinyin = "mang " Case -15448 To -15437: pinyin = "mao " Case -15436 To -15436: pinyin = "me " Case -15435 To -15420: pinyin = "mei " Case -15419 To -15417: pinyin = "men " Case -15416 To -15409: pinyin = "meng " Case -15408 To -15395: pinyin = "mi " Case -15394 To -15386: pinyin = "mian " Case -15385 To -15378: pinyin = "miao " Case -15377 To -15376: pinyin = "mie " Case -15375 To -15370: pinyin = "min " Case -15369 To -15364: pinyin = "ming " Case -15363 To -15363: pinyin = "miu " Case -15362 To -15184: pinyin = "mo " Case -15183 To -15181: pinyin = "mou " Case -15180 To -15166: pinyin = "mu " Case -15165 To -15159: pinyin = "na " Case -15158 To -15154: pinyin = "nai " Case -15153 To -15151: pinyin = "nan " Case -15150 To -15150: pinyin = "nang " Case -15149 To -15145: pinyin = "nao " Case -15144 To -15144: pinyin = "ne " Case -15143 To -15142: pinyin = "nei " Case -15141 To -15141: pinyin = "nen " Case -15140 To -15140: pinyin = "neng " Case -15139 To -15129: pinyin = "ni " Case -15128 To -15122: pinyin = "nian " Case -15121 To -15120: pinyin = "niang " Case -15119 To -15118: pinyin = "niao " Case -15117 To -15111: pinyin = "nie " Case -15110 To -15110: pinyin = "nin "Case -14941 To -14938: pinyin = "niu " Case -14937 To -14934: pinyin = "nong " Case -14933 To -14931: pinyin = "nu " Case -14930 To -14930: pinyin = "nv " Case -14929 To -14929: pinyin = "nuan " Case -14928 To -14927: pinyin = "nue " Case -14926 To -14923: pinyin = "nuo " Case -14922 To -14922: pinyin = "o " Case -14921 To -14915: pinyin = "ou " Case -14914 To -14909: pinyin = "pa " Case -14908 To -14903: pinyin = "pai " Case -14902 To -14895: pinyin = "pan " Case -14894 To -14890: pinyin = "pang " Case -14889 To -14883: pinyin = "pao " Case -14882 To -14874: pinyin = "pei " Case -14873 To -14872: pinyin = "pen " Case -14871 To -14858: pinyin = "peng " Case -14857 To -14679: pinyin = "pi " Case -14678 To -14675: pinyin = "pian " Case -14674 To -14671: pinyin = "piao " Case -14670 To -14669: pinyin = "pie " Case -14668 To -14664: pinyin = "pin " Case -14663 To -14655: pinyin = "ping " Case -14654 To -14646: pinyin = "po " Case -14645 To -14631: pinyin = "pu " Case -14630 To -14595: pinyin = "qi " Case -14594 To -14430: pinyin = "qia " Case -14429 To -14408: pinyin = "qian " Case -14407 To -14400: pinyin = "qiang " Case -14399 To -14385: pinyin = "qiao " Case -14384 To -14380: pinyin = "qie " Case -14379 To -14369: pinyin = "qin " Case -14368 To -14356: pinyin = "qing " Case -14355 To -14354: pinyin = "qiong " Case -14353 To -14346: pinyin = "qiu " Case -14345 To -14171: pinyin = "qu " Case -14170 To -14160: pinyin = "quan " Case -14159 To -14152: pinyin = "que " Case -14151 To -14150: pinyin = "qun " Case -14149 To -14146: pinyin = "ran " Case -14145 To -14141: pinyin = "rang " Case -14140 To -14138: pinyin = "rao " Case -14137 To -14136: pinyin = "re "Case -14125 To -14124: pinyin = "reng " Case -14123 To -14123: pinyin = "ri " Case -14122 To -14113: pinyin = "rong " Case -14112 To -14110: pinyin = "rou " Case -14109 To -14100: pinyin = "ru " Case -14099 To -14098: pinyin = "ruan " Case -14097 To -14095: pinyin = "rui " Case -14094 To -14093: pinyin = "run " Case -14092 To -14091: pinyin = "ruo " Case -14090 To -14088: pinyin = "sa " Case -14087 To -14084: pinyin = "sai " Case -14083 To -13918: pinyin = "san " Case -13917 To -13915: pinyin = "sang " Case -13914 To -13911: pinyin = "sao " Case -13910 To -13908: pinyin = "se " Case -13907 To -13907: pinyin = "sen " Case -13906 To -13906: pinyin = "seng " Case -13905 To -13897: pinyin = "sha " Case -13896 To -13895: pinyin = "shai " Case -13894 To -13879: pinyin = "shan " Case -13878 To -13871: pinyin = "shang " Case -13870 To -13860: pinyin = "shao " Case -13859 To -13848: pinyin = "she " Case -13847 To -13832: pinyin = "shen " Case -13831 To -13659: pinyin = "sheng " Case -13658 To -13612: pinyin = "shi " Case -13611 To -13602: pinyin = "shou " Case -13601 To -13407: pinyin = "shu " Case -13406 To -13405: pinyin = "shua " Case -13404 To -13401: pinyin = "shuai " Case -13400 To -13399: pinyin = "shuan " Case -13398 To -13396: pinyin = "shuang " Case -13395 To -13392: pinyin = "shui " Case -13391 To -13388: pinyin = "shun " Case -13387 To -13384: pinyin = "shuo " Case -13383 To -13368: pinyin = "si " Case -13367 To -13360: pinyin = "song " Case -13359 To -13357: pinyin = "sou " Case -13356 To -13344: pinyin = "su " Case -13343 To -13341: pinyin = "suan " Case -13340 To -13330: pinyin = "sui " Case -13329 To -13327: pinyin = "sun " Case -13326 To -13319: pinyin = "suo "Case -13147 To -13139: pinyin = "tai " Case -13138 To -13121: pinyin = "tan " Case -13120 To -13108: pinyin = "tang " Case -13107 To -13097: pinyin = "tao " Case -13096 To -13096: pinyin = "te " Case -13095 To -13092: pinyin = "teng " Case -13091 To -13077: pinyin = "ti " Case -13076 To -13069: pinyin = "tian " Case -13068 To -13064: pinyin = "tiao " Case -13063 To -13061: pinyin = "tie " Case -13060 To -12889: pinyin = "ting " Case -12888 To -12876: pinyin = "tong " Case -12875 To -12872: pinyin = "tou " Case -12871 To -12861: pinyin = "tu " Case -12860 To -12859: pinyin = "tuan " Case -12858 To -12853: pinyin = "tui " Case -12852 To -12850: pinyin = "tun " Case -12849 To -12839: pinyin = "tuo " Case -12838 To -12832: pinyin = "wa " Case -12831 To -12830: pinyin = "wai " Case -12829 To -12813: pinyin = "wan " Case -12812 To -12803: pinyin = "wang " Case -12802 To -12608: pinyin = "wei " Case -12607 To -12598: pinyin = "wen " Case -12597 To -12595: pinyin = "weng " Case -12594 To -12586: pinyin = "wo " Case -12585 To -12557: pinyin = "wu " Case -12556 To -12360: pinyin = "xi " Case -12359 To -12347: pinyin = "xia " Case -12346 To -12321: pinyin = "xian " Case -12320 To -12301: pinyin = "xiang " Case -12300 To -12121: pinyin = "xiao " Case -12120 To -12100: pinyin = "xie " Case -12099 To -12090: pinyin = "xin " Case -12089 To -12075: pinyin = "xing " Case -12074 To -12068: pinyin = "xiong " Case -12067 To -12059: pinyin = "xiu " Case -12058 To -12040: pinyin = "xu " Case -12039 To -11868: pinyin = "xuan " Case -11867 To -11862: pinyin = "xue " Case -11861 To -11848: pinyin = "xun " Case -11847 To -11832: pinyin = "ya " Case -11831 To -11799: pinyin = "yan "Case -11781 To -11605: pinyin = "yao " Case -11604 To -11590: pinyin = "ye " Case -11589 To -11537: pinyin = "yi " Case -11536 To -11359: pinyin = "yin " Case -11358 To -11341: pinyin = "ying " Case -11340 To -11340: pinyin = "yo " Case -11339 To -11325: pinyin = "yong " Case -11324 To -11304: pinyin = "you " Case -11303 To -11098: pinyin = "yu " Case -11097 To -11078: pinyin = "yuan " Case -11077 To -11068: pinyin = "yue " Case -11067 To -11056: pinyin = "yun " Case -11055 To -11053: pinyin = "za " Case -11052 To -11046: pinyin = "zai " Case -11045 To -11042: pinyin = "zan " Case -11041 To -11039: pinyin = "zang " Case -11038 To -11025: pinyin = "zao " Case -11024 To -11021: pinyin = "ze " Case -11020 To -11020: pinyin = "zei " Case -11019 To -11019: pinyin = "zen " Case -11018 To -11015: pinyin = "zeng " Case -11014 To -10839: pinyin = "zha " Case -10838 To -10833: pinyin = "zhai " Case -10832 To -10816: pinyin = "zhan " Case -10815 To -10801: pinyin = "zhang " Case -10800 To -10791: pinyin = "zhao " Case -10790 To -10781: pinyin = "zhe " Case -10780 To -10765: pinyin = "zhen " Case -10764 To -10588: pinyin = "zheng " Case -10587 To -10545: pinyin = "zhi " Case -10544 To -10534: pinyin = "zhong " Case -10533 To -10520: pinyin = "zhou " Case -10519 To -10332: pinyin = "zhu " Case -10331 To -10330: pinyin = "zhua " Case -10329 To -10329: pinyin = "zhuai " Case -10328 To -10323: pinyin = "zhuan " Case -10322 To -10316: pinyin = "zhuang " Case -10315 To -10310: pinyin = "zhui " Case -10309 To -10308: pinyin = "zhun " Case -10307 To -10297: pinyin = "zhuo " Case -10296 To -10282: pinyin = "zi " Case -10281 To -10275: pinyin = "zong " Case -10274 To -10271: pinyin = "zou "Case -10262 To -10261: pinyin = "zuan "Case -10260 To -10257: pinyin = "zui "Case -10256 To -10255: pinyin = "zun "Case -10254 To -10254: pinyin = "zuo "Case Else: pinyin = pEnd SelectEnd FunctionFunction getpy(str)For i = 1 To Len(str)getpy = getpy & pinyin(Mid(str, i, 1))Next iEnd Function只需要在Excel中使用=getpy(列)使用公式,去掉拼音之间的空格假设你的这个数据在A1单元格,在B1单元格输入:=SUBSTITUTE(A1," ","")。
EXCEL中直接把中文转换成拼音全拼
1.第一种方法:打开Excel->工具->宏->Viaual Basic编辑器在弹出来的窗口中对着VBAproject点右键->插入->模块下面会出现一个名为"模块1",点击在右边的空白栏中粘贴以下内容:Function getpychar(char)tmp = 65536 + Asc(char)If (tmp >= 45217 And tmp <= 45252) Thengetpychar = "A"ElseIf (tmp >= 45253 And tmp <= 45760) Then getpychar = "B"ElseIf (tmp >= 45761 And tmp <= 46317) Then getpychar = "C"ElseIf (tmp >= 46318 And tmp <= 46825) Then getpychar = "D"ElseIf (tmp >= 46826 And tmp <= 47009) Then getpychar = "E"ElseIf (tmp >= 47010 And tmp <= 47296) Then getpychar = "F"ElseIf (tmp >= 47297 And tmp <= 47613) Then getpychar = "G"ElseIf (tmp >= 47614 And tmp <= 48118) Then getpychar = "H"ElseIf (tmp >= 48119 And tmp <= 49061) Then getpychar = "J"ElseIf (tmp >= 49062 And tmp <= 49323) Then getpychar = "K"ElseIf (tmp >= 49324 And tmp <= 49895) Then getpychar = "L"ElseIf (tmp >= 49896 And tmp <= 50370) Then getpychar = "M"ElseIf (tmp >= 50371 And tmp <= 50613) Then getpychar = "N"ElseIf (tmp >= 50614 And tmp <= 50621) Then getpychar = "O"ElseIf (tmp >= 50622 And tmp <= 50905) Then getpychar = "P"ElseIf (tmp >= 50906 And tmp <= 51386) Then getpychar = "Q"ElseIf (tmp >= 51387 And tmp <= 51445) Then getpychar = "R"ElseIf (tmp >= 51446 And tmp <= 52217) Then getpychar = "S"ElseIf (tmp >= 52218 And tmp <= 52697) Then getpychar = "T"ElseIf (tmp >= 52698 And tmp <= 52979) Then getpychar = "W"ElseIf (tmp >= 52980 And tmp <= 53640) Then getpychar = "X"ElseIf (tmp >= 53689 And tmp <= 54480) Then getpychar = "Y"ElseIf (tmp >= 54481 And tmp <= 62289) Then getpychar = "Z"Else '如果不是中文,则不处理getpychar = charEnd IfEnd FunctionFunction getpy(str)For i = 1 To Len(str)getpy = getpy & getpychar(Mid(str, i, 1))Next iEnd Function现在转换函数已编写完成!关掉此编缉的窗口。
excel中把汉字转换成拼音的方法
excel中把汉字转换成拼音的方法在excel中把的汉字转换成拼音,拼音在字的上面,在word和EXCEL中,都可以,再粘贴到别的地方,用起来不如word,那么下面小编就教你具体怎么怎么把汉字转换成拼音吧。
希望对你有帮助!excel中把汉字转换成拼音的方法打开需要转换的excel表格单击excel表格的任意位置,然后按下ALT+F11,进入这个灰色的编辑界面excel中把汉字转换成拼音的方法图2插入--模块excel中把汉字转换成拼音的方法图3打开如下所示的界面。
excel中把汉字转换成拼音的方法图4把下面的内容复制粘贴到第四个步骤打开的界面中,并保存,参考下图操作。
Function pinyin(p As String) As Stringi = Asc(p)Select Case iCase -20319 To -20318: pinyin = "a "Case Else: pinyin = pEnd SelectEnd FunctionFunction getpy(str)For i = 1 To Len(str)getpy = getpy & pinyin(Mid(str, i, 1))Next iEnd Functionexcel中把汉字转换成拼音的方法图5保存,参考图片进行操作。
excel中把汉字转换成拼音的方法图6插入一列,用于存放转换后的拼音excel中把汉字转换成拼音的方法图7这里放在如果所示的这一列,在这一列中输入=getpy(转换源头所在的列)excel中把汉字转换成拼音的方法图8这是转成拼音后的效果excel中把汉字转换成拼音的方法图9这里的D2是数据源头excel中把汉字转换成拼音的方法图10。
EXCEL中直接把中文转换成拼音全拼
1.第一种方法:打开Excel-江具->宏->Viaual Basic编辑器在弹出来的窗口中对着VBAproject点右键->插入->模块下面会出现一个名为"模块1",点击在右边的空白栏中粘贴以下内容:Fun cti on getpychar(char)tmp = 65536 + Asc(char)If (tmp >= 45217 And tmp <= 45252) Thengetpychar = "A"ElseIf (tmp >= 45253 And tmp <= 45760) Then getpychar = "B"ElseIf (tmp >= 45761 And tmp <= 46317) Then getpychar = "C"ElseIf (tmp >= 46318 And tmp <= 46825) Then getpychar = "D"ElseIf (tmp >= 46826 And tmp <= 47009) Then getpychar = "E"ElseIf (tmp >= 47010 And tmp <= 47296) Then getpychar = "F"ElseIf (tmp >= 47297 And tmp <= 47613) Then getpychar = "G"ElseIf (tmp >= 47614 And tmp <= 48118) Then getpychar = "H"Elself (tmp >= 48119 And tmp <= 49061) Then getpychar = "J" ElseIf (tmp >= 49062 And tmp <= 49323) Thengetpychar = "K"ElseIf (tmp >= 49324 And tmp <= 49895) Thengetpychar = "L"ElseIf (tmp >= 49896 And tmp <= 50370) Thengetpychar = "M"ElseIf (tmp >= 50371 And tmp <= 50613) Thengetpychar = "N"ElseIf (tmp >= 50614 And tmp <= 50621) Thengetpychar = "O"ElseIf (tmp >= 50622 And tmp <= 50905) Thengetpychar = "P"ElseIf (tmp >= 50906 And tmp <= 51386) Thengetpychar = "Q"ElseIf (tmp >= 51387 And tmp <= 51445) Thengetpychar = "R"ElseIf (tmp >= 51446 And tmp <= 52217) Thengetpychar = "S"ElseIf (tmp >= 52218 And tmp <= 52697) Thengetpychar = "T"ElseIf (tmp >= 52698 And tmp <= 52979) Thengetpychar = "W"Elself (tmp >= 52980 And tmp <= 53640) Thengetpychar = "X"ElseIf (tmp >= 53689 And tmp <= 54480) Thengetpychar = "Y"ElseIf (tmp >= 54481 And tmp <= 62289) Thengetpychar = "Z"Else如果不是中文,则不处理getpychar = charEnd IfEnd Fun cti onFun cti on getpy(str)For i = 1 To Len( str)getpy = getpy & getpychar(Mid(str, i, 1))Next iEnd Fun cti on现在转换函数已编写完成!关掉此编缉的窗口。
excel如何批量将汉字转换成拼音
excel如何批量将汉字转换成拼音
excel如何批量将汉字转换成拼音
在日常工作,常常会用到Excel做表格,也许在这个过程中会输入姓名或其它名称等,然后再另一个格中显示对应的拼音,很多人会一个个的输入,其实是可以直接进行批量转换的。
下面随店铺一起看看吧。
excel批量将汉字转换成拼音的步骤
1、打开一张需要转换的Excel表格(如图所示,小编乱打的姓名,如有雷同,纯属巧合)
2、执行“工具→宏→Visual Basic编辑器”命令,或者直接按“Alt+F11”组合键,进入Visual Basic编辑状态。
也就是图中所用的灰色的编辑界面
3、如图所示,点击“插入→模块”命令
4、插入一个新模块后,会看到如图所示的界面
5、由于字数限制,代码过多无法在这里输入,代码以TXT文本格式存在百度云盘中
下载链接: /s/1pLguxFd
然后将文本中的所有代码复制后,粘贴到“步骤4”中的空白处
6、代码粘贴完成后,直接关闭Visual Basic编辑窗口即可,返回到Excel编辑状态
7、这时自定义函数就可以使用用了,如:要把A列的第2行的内容转换成拼音,放在B列的第2个单元格,输入公式:=getpy(A2),这里的A2,是指需要转换的汉子单元格的坐标,最后按“回车”即可
8、在通过下拉,批量实现多行的内容转换
PS:会有部分汉子无法转换只能手动转换了,代码的问题,可能是汉字太多无法全部识别吧,但是大部分转换成功后,其它个别的就好办多了,本实例也列出2个无法转换的汉字
excel汉字转换成拼音的。
EXCEL中直接把中文转换成拼音全拼
1.第一种方法:打开Excel-〉工具->宏->Viaual Basic编辑器在弹出来的窗口中对着VBAproject点右键->插入->模块下面会出现一个名为"模块1",点击在右边的空白栏中粘贴以下内容:Fun cti on getpychar(char)tmp = 65536 + Asc(char)If (tmp >= 45217 And tmp <= 45252) Thengetpychar = "A"ElseIf (tmp >= 45253 And tmp <= 45760) Then getpychar = "B"ElseIf (tmp >= 45761 And tmp <= 46317) Then getpychar = "C"ElseIf (tmp >= 46318 And tmp <= 46825) Then getpychar = "D"ElseIf (tmp >= 46826 And tmp <= 47009) Then getpychar = "E"ElseIf (tmp >= 47010 And tmp <= 47296) Then getpychar = "F"ElseIf (tmp >= 47297 And tmp <= 47613) Then getpychar = "G"ElseIf (tmp >= 47614 And tmp <= 48118) Then getpychar = "H"ElseIf (tmp >= 48119 And tmp <= 49061) Then getpychar = "J"ElseIf (tmp >= 49062 And tmp <= 49323) Then getpychar = "K"ElseIf (tmp >= 49324 And tmp <= 49895) Then getpychar = "L"ElseIf (tmp >= 49896 And tmp <= 50370) Then getpychar = "M"Elself (tmp >= 50371 And tmp <= 50613) Then getpychar = "N"ElseIf (tmp >= 50614 And tmp <= 50621) Then getpychar = "O"ElseIf (tmp >= 50622 And tmp <= 50905) Then getpychar = "P"ElseIf (tmp >= 50906 And tmp <= 51386) Then getpychar = "Q"ElseIf (tmp >= 51387 And tmp <= 51445) Then getpychar = "R"ElseIf (tmp >= 51446 And tmp <= 52217) Then getpychar = "S"ElseIf (tmp >= 52218 And tmp <= 52697) Then getpychar = "T"ElseIf (tmp >= 52698 And tmp <= 52979) Then getpychar = "W"ElseIf (tmp >= 52980 And tmp <= 53640) Then getpychar = "X"ElseIf (tmp >= 53689 And tmp <= 54480) Then getpychar = "Y"ElseIf (tmp >= 54481 And tmp <= 62289) Then getpychar = "Z"Else '如果不是中文,则不处理getpychar = charEnd IfEnd Fun cti onFun cti on getpy(str)For i = 1 To Len( str)getpy = getpy & getpychar(Mid(str, i, 1))Next iEnd Fun cti on现在转换函数已编写完成!关掉此编缉的窗口要在Excel中使用,方法如下:A1 A2中国=getpy(A1)2.第二种方法更简单些,但只能转单个字: =IF(LEN(A1)>0,LOOKUP(CODE(A1),45217+{0,36,544,1101,1609,1793,2080,2560,2902,3845,4107,4679,5154,5397,5405,5689,6170,6229,7001,7481,776 3,8472,9264},{"A","B","C","D","E","F","G","H","J","K","L","M","N","O","P","Q","R ","S","T","W","X","Y","Z"}),"")。
使用Excel快速获取姓名拼音
使用E x c e l快速获取姓名拼音The final edition was revised on December 14th, 2020.使用Excel快速获取姓名拼音召开会议或进行系统成员管理时,可能会需要批量获取姓名的汉语拼音,使用以下方法可以一劳永逸:1、新建一电子表格文件,内含两张表,一张命名为“转译”,一张命名为“资料”。
2、将以下内容粘至资料表的A1单元格(将会布满资料表的A1:B23单元格。
如果不好用鼠标选择,可将鼠标点在第一汉字前,按住Shift+向下键直到选完,然后按Ctrl+C复制,粘贴时右击鼠标后选择弹出的粘贴菜单的右侧那个去掉格式的按钮粘贴)吖 A八 B擦 C耷 D婀 E发 F噶G哈H肌J喀K垃L妈M拿N啪P期Q然R撒S塌T挖W西X压Y匝Z3、将以下资料粘至资料表的D1单元格(将会布满资料表的D1:E400单元格)吖 a安an肮ang凹ao八ba掰bai班ban邦bang包bao杯bei奔ben伻beng边bian 标biao 瘪bie 邠bin 冰bing 拨bo钸bu擦ca偲cai 参can 仓cang 糙cao 册ce参cen 噌ceng 叉cha 拆chai 觇chan 伥chang 抄chao 车che 抻chen 柽cheng充chong 抽chou 出chu欻chua 揣chuai 川chuan 窗chuang 吹chui 春chun 逴chuo 刺ci匆cong 凑cou粗cu汆cuan 崔cui村cun搓cuo咑da呆dai丹dan当dang 刀dao扽den 灯deng 氐di 嗲dia 掂dian 刁diao 爹die 丁ding 丢diu 东dong 兜dou 阇du 端duan 堆dui 吨dun 多duo 屙 e欸ei 奀en 鞥eng 儿er 发fa 帆fan飞fei 分fen 丰feng 佛fo缶fou 夫fu旮ga该gai 干gan 冈gang 皋gao 戈ge给gei 根gen 更geng 工gong 勾gou 估gu瓜gua 乖guai 关guan 光guang 归gui郭guo 哈ha孩hai 顸han 夯hang 蒿hao 呵he黑hei 痕hen 亨heng 轰hong 齁hou 乎hu花hua 怀huai 欢huan 肓huang 灰hui 昏hun 豁huo 几ji加jia 戋jian交jiao 节jie 巾jin 茎jing 垧jiong 纠jiu 居ju捐juan 撅jue 军jun 咔ka开kai 刊kan 康kang 尻kao 坷ke肯ken 阬keng 空kong 抠kou 刳ku夸kua 蒯kuai匡kuang 亏kui 坤kun 扩kuo 垃la来lai 兰lan 啷lang 捞lao 乐le勒lei 棱leng 黎li边lian 良liang 撩liao 咧lie 拎lin 令ling 溜liu 龙long 搂lou 撸lu抡lun 罗luo 驴lv 掠lve 妈ma 埋mai 嫚man 牤mang 猫mao 么me 没mei 闷men 蒙meng 咪mi 眠mian 喵miao 民min 名ming 谬miu 摸mo 哞mou 毪mu 那na囡nan 囊nang 孬nao 哪ne哪nei 恁nen 能neng 妮ni拈nian 酿niang 鸟niao 捏nie 您nin 宁ning 妞niu 农nong 耨nou 奴nu暖nuan 挪nuo 女nv疟nve 区ou拍pai 潘pan 乓pang 抛pao 呸pei 喷pen 烹peng 丕pi片pian 票piao 氕pie 拚pin 乒ping 钋po剖pou 仆pu七qi掐qia 千qian 强qiang 悄qiao 切qie 钦qin銎qiong 丘qiu 区qu悛quan 炔que 囷qun 蚺ran 嚷rang 饶rao 若re人ren 扔reng 日ri戎rong 柔rou 如ru阮ruan 蕤rui 闰run 若ruo 撒sa腮sai 三san搔sao色se森sen僧seng 杀sha筛shai 山shan 伤shang 捎shao 奢she申shen 升sheng 尸shi收shou 书shu刷shua 衰shuai 闩shuan 双shuang 谁shui 吮shun 说shuo 司si叟sou 苏su 狻suan 尿sui 孙sun 莎suo 他ta 台tai 坍tan 汤tang 涛tao 忑te 疼teng 体ti 天tian 佻tiao 帖tie 厅ting 恫tong 偷tou 凸tu 湍tuan 忒tui托tuo 挖wa歪wai 弯wan 汪wang 危wei 温wen 翁weng 挝wo乌wu夕xi虾xia 仙xian 乡xiang 肖xiao 些xie 心xin 兴xing 凶xiong 休xiu 需xu轩xuan 削xue丫ya 咽yan 央yang 幺yao 耶ye 一yi 因yin 应ying 庸yong 优you 迂yu 鸢yuan 曰yue 晕yun 扎za 灾zai 簪zan 赃zang 遭zao 则ze 贼zei 怎zen 曾zeng沾zhan 张zhang 钊zhao 折zhe这zhei 贞zhen 争zheng 之zhi中zhong 州zhou 朱zhu抓zhua 拽zhuai 专zhuan 庄zhuang 隹zhui 屯zhun 拙zhuo 孖zi宗zong 邹zou苴zu尊zun作zuo4、在将以下内容分别粘进转译表的A1~C1单元格中:姓名(2~4汉字,无空格)简拼全拼5、将以下公式粘进转译表的B2单元格并回车,以获得得姓名的简拼,注意不要多复制:=IF(LEN(A2)=2,LOOKUP(LEFT(A2,1),资料!$A$1:$B$23)&LOOKUP(RIGHT(A2,1),资料!$A$1:$B$23),IF(LEN(A2)=3,LOOKUP(LEFT(A2,1),资料!$A$1:$B$23)&LOOKUP(MID(A2,2,1),资料!$A$1:$B$23)&LOOKUP(RIGHT(A2,1),资料!$A$1:$B$23),IF(LEN(A2)=4,LOOKUP(LEFT(A2,1),资料!$A$1:$B$23)&LOOKUP(MID(A2,2,1),资料!$A$1:$B$23)&LOOKUP(MID(A2,3,1),资料!$A$1:$B$23)&LOOKUP(RIGHT(A2,1),资料!$A$1:$B$23),"请查检查姓名")))6、将以下公式粘进转译表的C2单元格并回车,以获得姓名的全拼:=IF(LEN(A2)=2,PROPER(LOOKUP(LEFT(A2,1),资料!$D$1:$E$400))&PROPER(LOOKUP(RIGHT(A2,1),资料!$D$1:$E$400)),IF(LEN(A2)=3,PROPER(LOOKUP(LEFT(A2,1),资料!$D$1:$E$400))&PROPER(LOOKUP(MID(A2,2,1),资料!$D$1:$E$400)),IF(LEN(A2)=4,PROPER(LOOKUP(LEFT(A2,1),资料!$D$1:$E$400))&PROPER(LOOKUP(MID(A2,2,1),资料!$D$1:$E$400))&PROPER(LOOKUP(MID(A2,3,1),资料!$D$1:$E$400))&PROPER(LOOKUP(RIGHT(A2,1),资料!$D$1:$E$400)),"请查检查姓名")))7、现在可以在A2开始的A列中输入汉字姓名了,最后根据需要向下填充公式即可。
Excel中文转拼音(完整版)
Excel中⽂转拼⾳(完整版)Excel中⽂转拼⾳(完整版)打开Excel->⼯具->宏->Viaual Basic编辑器在弹出来的窗⼝中对着VBAproject点右键->插⼊->模块下⾯会出现⼀个名为"模块1",点击在右边的空⽩栏中粘贴以下内容:Function pinyin(p As String) As Stringi = Asc(p)Select Case iCase -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 To -19726: pinyin = "chai"Case -19725 To -19716: pinyin = "chan"Case -19715 To -19541: pinyin = "chang"Case -19540 To -19532: pinyin = "chao"Case -19531 To -19526: pinyin = "che"Case -19525 To -19516: pinyin = "chen"Case -19515 To -19501: pinyin = "cheng"Case -19500 To -19485: pinyin = "chi"Case -19484 To -19480: pinyin = "chong"Case -19479 To -19468: pinyin = "chou"Case -19467 To -19290: pinyin = "chu"Case -19270 To -19264: pinyin = "chun" Case -19263 To -19262: pinyin = "chuo" Case -19261 To -19250: pinyin = "ci" Case -19249 To -19244: pinyin = "cong" Case -19243 To -19243: pinyin = "cou" Case -19242 To -19239: pinyin = "cu" Case -19238 To -19236: pinyin = "cuan" Case -19235 To -19228: pinyin = "cui" Case -19227 To -19225: pinyin = "cun" Case -19224 To -19219: pinyin = "cuo" Case -19218 To -19213: pinyin = "da" Case -19212 To -19039: pinyin = "dai" Case -19038 To -19024: pinyin = "dan" Case -19023 To -19019: pinyin = "dang" Case -19018 To -19007: pinyin = "dao" Case -19006 To -19004: pinyin = "de" Case -19003 To -18997: pinyin = "deng" Case -18996 To -18978: pinyin = "di" Case -18977 To -18962: pinyin = "dian" Case -18961 To -18953: pinyin = "diao" Case -18952 To -18784: pinyin = "die" Case -18783 To -18775: pinyin = "ding" Case -18774 To -18774: pinyin = "diu" Case -18773 To -18527: pinyin = "dong" Case -18526 To -18519: pinyin = "fa" Case -18518 To -18502: pinyin = "fan" Case -18501 To -18491: pinyin = "fang" Case -18490 To -18479: pinyin = "fei" Case -18478 To -18464: pinyin = "fen" Case -18463 To -18449: pinyin = "feng" Case -18448 To -18448: pinyin = "fo" Case -18447 To -18447: pinyin = "fou" Case -18446 To -18240: pinyin = "fu" Case -18239 To -18238: pinyin = "ga" Case -18237 To -18232: pinyin = "gai" Case -18231 To -18221: pinyin = "gan" Case -18220 To -18212: pinyin = "gang" Case -18211 To -18202: pinyin = "gao" Case -18201 To -18185: pinyin = "ge" Case -18184 To -18184: pinyin = "gei" Case -18183 To -18182: pinyin = "gen" Case -18181 To -18013: pinyin = "geng" Case -18012 To -17998: pinyin = "gong" Case -17997 To -17989: pinyin = "gou" Case -17988 To -17971: pinyin = "gu" Case -17970 To -17965: pinyin = "gua" Case -17964 To -17962: pinyin = "guai" Case -17961 To -17951: pinyin = "guan" Case -17950 To -17948: pinyin = "guang" Case -17947 To -17932: pinyin = "gui" Case -17931 To -17929: pinyin = "gun" Case -17928 To -17923: pinyin = "guo" Case -17922 To -17760: pinyin = "ha"Case -17692 To -17684: pinyin = "hong" Case -17683 To -17677: pinyin = "hou" Case -17676 To -17497: pinyin = "hu" Case -17496 To -17488: pinyin = "hua" Case -17487 To -17483: pinyin = "huai" Case -17482 To -17469: pinyin = "huan" Case -17468 To -17455: pinyin = "huang" Case -17454 To -17434: pinyin = "hui" Case -17433 To -17428: pinyin = "hun" Case -17427 To -17418: pinyin = "huo" Case -17417 To -17203: pinyin = "ji" Case -17202 To -17186: pinyin = "jia" Case -17185 To -16984: pinyin = "jian" Case -16983 To -16971: pinyin = "jiang" Case -16970 To -16943: pinyin = "jiao" Case -16942 To -16916: pinyin = "jie" Case -16915 To -16734: pinyin = "jin" Case -16733 To -16709: pinyin = "jing" Case -16708 To -16707: pinyin = "jiong" Case -16706 To -16690: pinyin = "jiu" Case -16689 To -16665: pinyin = "ju" Case -16664 To -16658: pinyin = "juan" Case -16657 To -16648: pinyin = "jue" Case -16647 To -16475: pinyin = "jun" Case -16474 To -16471: pinyin = "ka" Case -16470 To -16466: pinyin = "kai" Case -16465 To -16460: pinyin = "kan" Case -16459 To -16453: pinyin = "kang" Case -16452 To -16449: pinyin = "kao" Case -16448 To -16434: pinyin = "ke" Case -16433 To -16430: pinyin = "ken" Case -16429 To -16428: pinyin = "keng" Case -16427 To -16424: pinyin = "kong" Case -16423 To -16420: pinyin = "kou" Case -16419 To -16413: pinyin = "ku" Case -16412 To -16408: pinyin = "kua" Case -16407 To -16404: pinyin = "kuai" Case -16403 To -16402: pinyin = "kuan" Case -16401 To -16394: pinyin = "kuang" Case -16393 To -16221: pinyin = "kui" Case -16220 To -16217: pinyin = "kun" Case -16216 To -16213: pinyin = "kuo" Case -16212 To -16206: pinyin = "la" Case -16205 To -16203: pinyin = "lai" Case -16202 To -16188: pinyin = "lan" Case -16187 To -16181: pinyin = "lang" Case -16180 To -16172: pinyin = "lao" Case -16171 To -16170: pinyin = "le" Case -16169 To -16159: pinyin = "lei" Case -16158 To -16156: pinyin = "leng"Case -15903 To -15890: pinyin = "ling" Case -15889 To -15879: pinyin = "liu" Case -15878 To -15708: pinyin = "long" Case -15707 To -15702: pinyin = "lou" Case -15701 To -15682: pinyin = "lu" Case -15681 To -15668: pinyin = "lv" Case -15667 To -15662: pinyin = "luan" Case -15661 To -15660: pinyin = "lue" Case -15659 To -15653: pinyin = "lun" Case -15652 To -15641: pinyin = "luo" Case -15640 To -15632: pinyin = "ma" Case -15631 To -15626: pinyin = "mai" Case -15625 To -15455: pinyin = "man" Case -15454 To -15449: pinyin = "mang" Case -15448 To -15437: pinyin = "mao" Case -15436 To -15436: pinyin = "me" Case -15435 To -15420: pinyin = "mei" Case -15419 To -15417: pinyin = "men" Case -15416 To -15409: pinyin = "meng" Case -15408 To -15395: pinyin = "mi" Case -15394 To -15386: pinyin = "mian" Case -15385 To -15378: pinyin = "miao" Case -15377 To -15376: pinyin = "mie" Case -15375 To -15370: pinyin = "min" Case -15369 To -15364: pinyin = "ming" Case -15363 To -15363: pinyin = "miu" Case -15362 To -15184: pinyin = "mo" Case -15183 To -15181: pinyin = "mou" Case -15180 To -15166: pinyin = "mu" Case -15165 To -15159: pinyin = "na" Case -15158 To -15154: pinyin = "nai" Case -15153 To -15151: pinyin = "nan" Case -15150 To -15150: pinyin = "nang" Case -15149 To -15145: pinyin = "nao" Case -15144 To -15144: pinyin = "ne" Case -15143 To -15142: pinyin = "nei" Case -15141 To -15141: pinyin = "nen" Case -15140 To -15140: pinyin = "neng" Case -15139 To -15129: pinyin = "ni" Case -15128 To -15122: pinyin = "nian" Case -15121 To -15120: pinyin = "niang" Case -15119 To -15118: pinyin = "niao" Case -15117 To -15111: pinyin = "nie" Case -15110 To -15110: pinyin = "nin" Case -15109 To -14942: pinyin = "ning" Case -14941 To -14938: pinyin = "niu" Case -14937 To -14934: pinyin = "nong" Case -14933 To -14931: pinyin = "nu" Case -14930 To -14930: pinyin = "nv" Case -14929 To -14929: pinyin = "nuan"Case -14894 To -14890: pinyin = "pang" Case -14889 To -14883: pinyin = "pao" Case -14882 To -14874: pinyin = "pei" Case -14873 To -14872: pinyin = "pen" Case -14871 To -14858: pinyin = "peng" Case -14857 To -14679: pinyin = "pi" Case -14678 To -14675: pinyin = "pian" Case -14674 To -14671: pinyin = "piao" Case -14670 To -14669: pinyin = "pie" Case -14668 To -14664: pinyin = "pin" Case -14663 To -14655: pinyin = "ping" Case -14654 To -14646: pinyin = "po" Case -14645 To -14631: pinyin = "pu" Case -14630 To -14595: pinyin = "qi" Case -14594 To -14430: pinyin = "qia" Case -14429 To -14408: pinyin = "qian" Case -14407 To -14400: pinyin = "qiang" Case -14399 To -14385: pinyin = "qiao" Case -14384 To -14380: pinyin = "qie" Case -14379 To -14369: pinyin = "qin" Case -14368 To -14356: pinyin = "qing" Case -14355 To -14354: pinyin = "qiong" Case -14353 To -14346: pinyin = "qiu" Case -14345 To -14171: pinyin = "qu" Case -14170 To -14160: pinyin = "quan" Case -14159 To -14152: pinyin = "que" Case -14151 To -14150: pinyin = "qun" Case -14149 To -14146: pinyin = "ran" Case -14145 To -14141: pinyin = "rang" Case -14140 To -14138: pinyin = "rao" Case -14137 To -14136: pinyin = "re" Case -14135 To -14126: pinyin = "ren" Case -14125 To -14124: pinyin = "reng" Case -14123 To -14123: pinyin = "ri" Case -14122 To -14113: pinyin = "rong" Case -14112 To -14110: pinyin = "rou" Case -14109 To -14100: pinyin = "ru" Case -14099 To -14098: pinyin = "ruan" Case -14097 To -14095: pinyin = "rui" Case -14094 To -14093: pinyin = "run" Case -14092 To -14091: pinyin = "ruo" Case -14090 To -14088: pinyin = "sa" Case -14087 To -14084: pinyin = "sai" Case -14083 To -13918: pinyin = "san" Case -13917 To -13915: pinyin = "sang" Case -13914 To -13911: pinyin = "sao" Case -13910 To -13908: pinyin = "se" Case -13907 To -13907: pinyin = "sen" Case -13906 To -13906: pinyin = "seng" Case -13905 To -13897: pinyin = "sha"Case -13658 To -13612: pinyin = "shi" Case -13611 To -13602: pinyin = "shou" Case -13601 To -13407: pinyin = "shu" Case -13406 To -13405: pinyin = "shua" Case -13404 To -13401: pinyin = "shuai" Case -13400 To -13399: pinyin = "shuan" Case -13398 To -13396: pinyin = "shuang" Case -13395 To -13392: pinyin = "shui" Case -13391 To -13388: pinyin = "shun" Case -13387 To -13384: pinyin = "shuo" Case -13383 To -13368: pinyin = "si" Case -13367 To -13360: pinyin = "song" Case -13359 To -13357: pinyin = "sou" Case -13356 To -13344: pinyin = "su" Case -13343 To -13341: pinyin = "suan" Case -13340 To -13330: pinyin = "sui" Case -13329 To -13327: pinyin = "sun" Case -13326 To -13319: pinyin = "suo" Case -13318 To -13148: pinyin = "ta" Case -13147 To -13139: pinyin = "tai" Case -13138 To -13121: pinyin = "tan" Case -13120 To -13108: pinyin = "tang" Case -13107 To -13097: pinyin = "tao" Case -13096 To -13096: pinyin = "te" Case -13095 To -13092: pinyin = "teng" Case -13091 To -13077: pinyin = "ti" Case -13076 To -13069: pinyin = "tian" Case -13068 To -13064: pinyin = "tiao" Case -13063 To -13061: pinyin = "tie" Case -13060 To -12889: pinyin = "ting" Case -12888 To -12876: pinyin = "tong" Case -12875 To -12872: pinyin = "tou" Case -12871 To -12861: pinyin = "tu" Case -12860 To -12859: pinyin = "tuan" Case -12858 To -12853: pinyin = "tui" Case -12852 To -12850: pinyin = "tun" Case -12849 To -12839: pinyin = "tuo" Case -12838 To -12832: pinyin = "wa" Case -12831 To -12830: pinyin = "wai" Case -12829 To -12813: pinyin = "wan" Case -12812 To -12803: pinyin = "wang" Case -12802 To -12608: pinyin = "wei" Case -12607 To -12598: pinyin = "wen" Case -12597 To -12595: pinyin = "weng" Case -12594 To -12586: pinyin = "wo" Case -12585 To -12557: pinyin = "wu" Case -12556 To -12360: pinyin = "xi" Case -12359 To -12347: pinyin = "xia" Case -12346 To -12321: pinyin = "xian" Case -12320 To -12301: pinyin = "xiang"Case -12039 To -11868: pinyin = "xuan" Case -11867 To -11862: pinyin = "xue" Case -11861 To -11848: pinyin = "xun" Case -11847 To -11832: pinyin = "ya" Case -11831 To -11799: pinyin = "yan" Case -11798 To -11782: pinyin = "yang" Case -11781 To -11605: pinyin = "yao" Case -11604 To -11590: pinyin = "ye" Case -11589 To -11537: pinyin = "yi" Case -11536 To -11359: pinyin = "yin" Case -11358 To -11341: pinyin = "ying" Case -11340 To -11340: pinyin = "yo" Case -11339 To -11325: pinyin = "yong" Case -11324 To -11304: pinyin = "you" Case -11303 To -11098: pinyin = "yu" Case -11097 To -11078: pinyin = "yuan" Case -11077 To -11068: pinyin = "yue" Case -11067 To -11056: pinyin = "yun" Case -11055 To -11053: pinyin = "za" Case -11052 To -11046: pinyin = "zai" Case -11045 To -11042: pinyin = "zan" Case -11041 To -11039: pinyin = "zang" Case -11038 To -11025: pinyin = "zao" Case -11024 To -11021: pinyin = "ze" Case -11020 To -11020: pinyin = "zei" Case -11019 To -11019: pinyin = "zen" Case -11018 To -11015: pinyin = "zeng" Case -11014 To -10839: pinyin = "zha" Case -10838 To -10833: pinyin = "zhai" Case -10832 To -10816: pinyin = "zhan" Case -10815 To -10801: pinyin = "zhang" Case -10800 To -10791: pinyin = "zhao" Case -10790 To -10781: pinyin = "zhe" Case -10780 To -10765: pinyin = "zhen" Case -10764 To -10588: pinyin = "zheng" Case -10587 To -10545: pinyin = "zhi" Case -10544 To -10534: pinyin = "zhong" Case -10533 To -10520: pinyin = "zhou" Case -10519 To -10332: pinyin = "zhu" Case -10331 To -10330: pinyin = "zhua" Case -10329 To -10329: pinyin = "zhuai" Case -10328 To -10323: pinyin = "zhuan" Case -10322 To -10316: pinyin = "zhuang" Case -10315 To -10310: pinyin = "zhui" Case -10309 To -10308: pinyin = "zhun" Case -10307 To -10297: pinyin = "zhuo" Case -10296 To -10282: pinyin = "zi" Case -10281 To -10275: pinyin = "zong" Case -10274 To -10271: pinyin = "zou" Case -10270 To -10263: pinyin = "zu"Case Else: pinyin = pEnd SelectEnd FunctionFunction getpy(str)For i = 1 To Len(str)getpy = getpy & pinyin(Mid(str, i, 1))Next iEnd Function********复制到此结束,本⾏不复制*******现在转换函数已编写完成!关掉此编缉的窗⼝。
EXCEL如何自动将姓名转换为拼音?
EXCEL如何自动将姓名转换为拼音?EXCEL如何自动将姓名转换为拼音,由于EXCEL中没有汉字自动转换拼音的功能,所以要在VBA中自定义一个转换函数。
具体操作步骤第一步,要把EXCEL文档转换为 XLSM格式,启用宏。
第二步,在文件,设置,自定义功能区中勾选开发工具。
第三步,打开VBA编辑器。
第四步,插入模块。
第五步,在模块中输入如下代码:Function pinyin(p As String) As String i = Asc(p)Select Case iCase -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 To -19726: pinyin = 'chai ' Case -19725 To -19716: pinyin = 'chan ' Case -19715 To -19541: pinyin = 'chang ' Case -19540 To -19532: pinyin = 'chao ' Case -19531 To -19526: pinyin = 'che ' Case -19525 To -19516: pinyin = 'chen ' Case -19515 To -19501: pinyin = 'cheng ' Case -19500 To -19485: pinyin = 'chi ' Case -19484 To -19480: pinyin = 'chong ' Case -19479 To -19468: pinyin = 'chou ' Case -19467 To -19290: pinyin = 'chu ' Case -19289 To -19289: pinyin = 'chuai ' Case -19288 To -19282: pinyin = 'chuan ' Case -19281 To -19276: pinyin = 'chuang ' Case -19275 To -19271: pinyin = 'chui 'Case -19270 To -19264: pinyin = 'chun ' Case -19263 To -19262: pinyin = 'chuo ' Case -19261 To -19250: pinyin = 'ci ' Case -19249 To -19244: pinyin = 'cong ' Case -19243 To -19243: pinyin = 'cou ' Case -19242 To -19239: pinyin = 'cu ' Case -19238 To -19236: pinyin = 'cuan ' Case -19235 To -19228: pinyin = 'cui ' Case -19227 To -19225: pinyin = 'cun ' Case -19224 To -19219: pinyin = 'cuo ' Case -19218 To -19213: pinyin = 'da ' Case -19212 To -19039: pinyin = 'dai ' Case -19038 To -19024: pinyin = 'dan ' Case -19023 To -19019: pinyin = 'dang ' Case -19018 To -19007: pinyin = 'dao ' Case -19006 To -19004: pinyin = 'de ' Case -19003 To -18997: pinyin = 'deng ' Case -18996 To -18978: pinyin = 'di ' Case -18977 To -18962: pinyin = 'dian ' Case -18961 To -18953: pinyin = 'diao ' Case -18952 To -18784: pinyin = 'die ' Case -18783 To -18775: pinyin = 'ding ' Case -18774 To -18774: pinyin = 'diu ' Case -18773 To -18527: pinyin = 'dong ' Case -18526 To -18519: pinyin = 'fa ' Case -18518 To -18502: pinyin = 'fan ' Case -18501 To -18491: pinyin = 'fang ' Case -18490 To -18479: pinyin = 'fei ' Case -18478 To -18464: pinyin = 'fen ' Case -18463 To -18449: pinyin = 'feng 'Case -18448 To -18448: pinyin = 'fo ' Case -18447 To -18447: pinyin = 'fou ' Case -18446 To -18240: pinyin = 'fu ' Case -18239 To -18238: pinyin = 'ga ' Case -18237 To -18232: pinyin = 'gai ' Case -18231 To -18221: pinyin = 'gan ' Case -18220 To -18212: pinyin = 'gang ' Case -18211 To -18202: pinyin = 'gao ' Case -18201 To -18185: pinyin = 'ge ' Case -18184 To -18184: pinyin = 'gei ' Case -18183 To -18182: pinyin = 'gen ' Case -18181 To -18013: pinyin = 'geng ' Case -18012 To -17998: pinyin = 'gong ' Case -17997 To -17989: pinyin = 'gou ' Case -17988 To -17971: pinyin = 'gu ' Case -17970 To -17965: pinyin = 'gua ' Case -17964 To -17962: pinyin = 'guai ' Case -17961 To -17951: pinyin = 'guan ' Case -17950 To -17948: pinyin = 'guang ' Case -17947 To -17932: pinyin = 'gui ' Case -17931 To -17929: pinyin = 'gun ' Case -17928 To -17923: pinyin = 'guo ' Case -17922 To -17760: pinyin = 'ha ' Case -17759 To -17753: pinyin = 'hai ' Case -17752 To -17734: pinyin = 'han ' Case -17733 To -17731: pinyin = 'hang ' Case -17730 To -17722: pinyin = 'hao ' Case -17721 To -17704: pinyin = 'he ' Case -17703 To -17702: pinyin = 'hei ' Case -17701 To -17698: pinyin = 'hen 'Case -17697 To -17693: pinyin = 'heng ' Case -17692 To -17684: pinyin = 'hong ' Case -17683 To -17677: pinyin = 'hou ' Case -17676 To -17497: pinyin = 'hu ' Case -17496 To -17488: pinyin = 'hua ' Case -17487 To -17483: pinyin = 'huai ' Case -17482 To -17469: pinyin = 'huan ' Case -17468 To -17455: pinyin = 'huang ' Case -17454 To -17434: pinyin = 'hui ' Case -17433 To -17428: pinyin = 'hun ' Case -17427 To -17418: pinyin = 'huo ' Case -17417 To -17203: pinyin = 'ji ' Case -17202 To -17186: pinyin = 'jia ' Case -17185 To -16984: pinyin = 'jian ' Case -16983 To -16971: pinyin = 'jiang ' Case -16970 To -16943: pinyin = 'jiao ' Case -16942 To -16916: pinyin = 'jie ' Case -16915 To -16734: pinyin = 'jin ' Case -16733 To -16709: pinyin = 'jing ' Case -16708 To -16707: pinyin = 'jiong ' Case -16706 To -16690: pinyin = 'jiu ' Case -16689 To -16665: pinyin = 'ju ' Case -16664 To -16658: pinyin = 'juan ' Case -16657 To -16648: pinyin = 'jue ' Case -16647 To -16475: pinyin = 'jun ' Case -16474 To -16471: pinyin = 'ka ' Case -16470 To -16466: pinyin = 'kai ' Case -16465 To -16460: pinyin = 'kan ' Case -16459 To -16453: pinyin = 'kang ' Case -16452 To -16449: pinyin = 'kao 'Case -16448 To -16434: pinyin = 'ke ' Case -16433 To -16430: pinyin = 'ken ' Case -16429 To -16428: pinyin = 'keng ' Case -16427 To -16424: pinyin = 'kong ' Case -16423 To -16420: pinyin = 'kou ' Case -16419 To -16413: pinyin = 'ku ' Case -16412 To -16408: pinyin = 'kua ' Case -16407 To -16404: pinyin = 'kuai ' Case -16403 To -16402: pinyin = 'kuan ' Case -16401 To -16394: pinyin = 'kuang ' Case -16393 To -16221: pinyin = 'kui ' Case -16220 To -16217: pinyin = 'kun ' Case -16216 To -16213: pinyin = 'kuo ' Case -16212 To -16206: pinyin = 'la ' Case -16205 To -16203: pinyin = 'lai ' Case -16202 To -16188: pinyin = 'lan ' Case -16187 To -16181: pinyin = 'lang ' Case -16180 To -16172: pinyin = 'lao ' Case -16171 To -16170: pinyin = 'le ' Case -16169 To -16159: pinyin = 'lei ' Case -16158 To -16156: pinyin = 'leng ' Case -16155 To -15960: pinyin = 'li ' Case -15959 To -15959: pinyin = 'lia ' Case -15958 To -15945: pinyin = 'lian ' Case -15944 To -15934: pinyin = 'liang ' Case -15933 To -15921: pinyin = 'liao ' Case -15920 To -15916: pinyin = 'lie ' Case -15915 To -15904: pinyin = 'lin ' Case -15903 To -15890: pinyin = 'ling ' Case -15889 To -15879: pinyin = 'liu 'Case -15707 To -15702: pinyin = 'lou ' Case -15701 To -15682: pinyin = 'lu ' Case -15681 To -15668: pinyin = 'lv ' Case -15667 To -15662: pinyin = 'luan ' Case -15661 To -15660: pinyin = 'lue ' Case -15659 To -15653: pinyin = 'lun ' Case -15652 To -15641: pinyin = 'luo ' Case -15640 To -15632: pinyin = 'ma ' Case -15631 To -15626: pinyin = 'mai ' Case -15625 To -15455: pinyin = 'man ' Case -15454 To -15449: pinyin = 'mang ' Case -15448 To -15437: pinyin = 'mao ' Case -15436 To -15436: pinyin = 'me ' Case -15435 To -15420: pinyin = 'mei ' Case -15419 To -15417: pinyin = 'men ' Case -15416 To -15409: pinyin = 'meng ' Case -15408 To -15395: pinyin = 'mi ' Case -15394 To -15386: pinyin = 'mian ' Case -15385 To -15378: pinyin = 'miao ' Case -15377 To -15376: pinyin = 'mie ' Case -15375 To -15370: pinyin = 'min ' Case -15369 To -15364: pinyin = 'ming ' Case -15363 To -15363: pinyin = 'miu ' Case -15362 To -15184: pinyin = 'mo ' Case -15183 To -15181: pinyin = 'mou ' Case -15180 To -15166: pinyin = 'mu ' Case -15165 To -15159: pinyin = 'na ' Case -15158 To -15154: pinyin = 'nai ' Case -15153 To -15151: pinyin = 'nan 'Case -15149 To -15145: pinyin = 'nao ' Case -15144 To -15144: pinyin = 'ne ' Case -15143 To -15142: pinyin = 'nei ' Case -15141 To -15141: pinyin = 'nen ' Case -15140 To -15140: pinyin = 'neng ' Case -15139 To -15129: pinyin = 'ni ' Case -15128 To -15122: pinyin = 'nian ' Case -15121 To -15120: pinyin = 'niang ' Case -15119 To -15118: pinyin = 'niao ' Case -15117 To -15111: pinyin = 'nie ' Case -15110 To -15110: pinyin = 'nin ' Case -15109 To -14942: pinyin = 'ning ' Case -14941 To -14938: pinyin = 'niu ' Case -14937 To -14934: pinyin = 'nong ' Case -14933 To -14931: pinyin = 'nu ' Case -14930 To -14930: pinyin = 'nv ' Case -14929 To -14929: pinyin = 'nuan ' Case -14928 To -14927: pinyin = 'nue ' Case -14926 To -14923: pinyin = 'nuo ' Case -14922 To -14922: pinyin = 'o ' Case -14921 To -14915: pinyin = 'ou ' Case -14914 To -14909: pinyin = 'pa ' Case -14908 To -14903: pinyin = 'pai ' Case -14902 To -14895: pinyin = 'pan ' Case -14894 To -14890: pinyin = 'pang ' Case -14889 To -14883: pinyin = 'pao ' Case -14882 To -14874: pinyin = 'pei ' Case -14873 To -14872: pinyin = 'pen ' Case -14871 To -14858: pinyin = 'peng 'Case -14857 To -14679: pinyin = 'pi ' Case -14678 To -14675: pinyin = 'pian ' Case -14674 To -14671: pinyin = 'piao ' Case -14670 To -14669: pinyin = 'pie ' Case -14668 To -14664: pinyin = 'pin ' Case -14663 To -14655: pinyin = 'ping ' Case -14654 To -14646: pinyin = 'po ' Case -14645 To -14631: pinyin = 'pu ' Case -14630 To -14595: pinyin = 'qi ' Case -14594 To -14430: pinyin = 'qia ' Case -14429 To -14408: pinyin = 'qian ' Case -14407 To -14400: pinyin = 'qiang ' Case -14399 To -14385: pinyin = 'qiao ' Case -14384 To -14380: pinyin = 'qie ' Case -14379 To -14369: pinyin = 'qin ' Case -14368 To -14356: pinyin = 'qing ' Case -14355 To -14354: pinyin = 'qiong ' Case -14353 To -14346: pinyin = 'qiu ' Case -14345 To -14171: pinyin = 'qu ' Case -14170 To -14160: pinyin = 'quan ' Case -14159 To -14152: pinyin = 'que ' Case -14151 To -14150: pinyin = 'qun ' Case -14149 To -14146: pinyin = 'ran ' Case -14145 To -14141: pinyin = 'rang ' Case -14140 To -14138: pinyin = 'rao ' Case -14137 To -14136: pinyin = 're ' Case -14135 To -14126: pinyin = 'ren ' Case -14125 To -14124: pinyin = 'reng ' Case -14123 To -14123: pinyin = 'ri ' Case -14122 To -14113: pinyin = 'rong 'Case -14112 To -14110: pinyin = 'rou ' Case -14109 To -14100: pinyin = 'ru ' Case -14099 To -14098: pinyin = 'ruan ' Case -14097 To -14095: pinyin = 'rui ' Case -14094 To -14093: pinyin = 'run ' Case -14092 To -14091: pinyin = 'ruo ' Case -14090 To -14088: pinyin = 'sa ' Case -14087 To -14084: pinyin = 'sai ' Case -14083 To -13918: pinyin = 'san ' Case -13917 To -13915: pinyin = 'sang ' Case -13914 To -13911: pinyin = 'sao ' Case -13910 To -13908: pinyin = 'se ' Case -13907 To -13907: pinyin = 'sen ' Case -13906 To -13906: pinyin = 'seng ' Case -13905 To -13897: pinyin = 'sha ' Case -13896 To -13895: pinyin = 'shai ' Case -13894 To -13879: pinyin = 'shan ' Case -13878 To -13871: pinyin = 'shang ' Case -13870 To -13860: pinyin = 'shao ' Case -13859 To -13848: pinyin = 'she ' Case -13847 To -13832: pinyin = 'shen ' Case -13831 To -13659: pinyin = 'sheng ' Case -13658 To -13612: pinyin = 'shi ' Case -13611 To -13602: pinyin = 'shou ' Case -13601 To -13407: pinyin = 'shu ' Case -13406 To -13405: pinyin = 'shua ' Case -13404 To -13401: pinyin = 'shuai ' Case -13400 To -13399: pinyin = 'shuan ' Case -13398 To -13396: pinyin = 'shuang ' Case -13395 To -13392: pinyin = 'shui 'Case -13391 To -13388: pinyin = 'shun ' Case -13387 To -13384: pinyin = 'shuo ' Case -13383 To -13368: pinyin = 'si ' Case -13367 To -13360: pinyin = 'song ' Case -13359 To -13357: pinyin = 'sou ' Case -13356 To -13344: pinyin = 'su ' Case -13343 To -13341: pinyin = 'suan ' Case -13340 To -13330: pinyin = 'sui ' Case -13329 To -13327: pinyin = 'sun ' Case -13326 To -13319: pinyin = 'suo ' Case -13318 To -13148: pinyin = 'ta ' Case -13147 To -13139: pinyin = 'tai ' Case -13138 To -13121: pinyin = 'tan ' Case -13120 To -13108: pinyin = 'tang ' Case -13107 To -13097: pinyin = 'tao ' Case -13096 To -13096: pinyin = 'te ' Case -13095 To -13092: pinyin = 'teng ' Case -13091 To -13077: pinyin = 'ti ' Case -13076 To -13069: pinyin = 'tian ' Case -13068 To -13064: pinyin = 'tiao ' Case -13063 To -13061: pinyin = 'tie ' Case -13060 To -12889: pinyin = 'ting ' Case -12888 To -12876: pinyin = 'tong ' Case -12875 To -12872: pinyin = 'tou ' Case -12871 To -12861: pinyin = 'tu ' Case -12860 To -12859: pinyin = 'tuan ' Case -12858 To -12853: pinyin = 'tui ' Case -12852 To -12850: pinyin = 'tun ' Case -12849 To -12839: pinyin = 'tuo ' Case -12838 To -12832: pinyin = 'wa 'Case -12829 To -12813: pinyin = 'wan ' Case -12812 To -12803: pinyin = 'wang ' Case -12802 To -12608: pinyin = 'wei ' Case -12607 To -12598: pinyin = 'wen ' Case -12597 To -12595: pinyin = 'weng ' Case -12594 To -12586: pinyin = 'wo ' Case -12585 To -12557: pinyin = 'wu ' Case -12556 To -12360: pinyin = 'xi ' Case -12359 To -12347: pinyin = 'xia ' Case -12346 To -12321: pinyin = 'xian ' Case -12320 To -12301: pinyin = 'xiang ' Case -12300 To -12121: pinyin = 'xiao ' Case -12120 To -12100: pinyin = 'xie ' Case -12099 To -12090: pinyin = 'xin ' Case -12089 To -12075: pinyin = 'xing ' Case -12074 To -12068: pinyin = 'xiong ' Case -12067 To -12059: pinyin = 'xiu ' Case -12058 To -12040: pinyin = 'xu ' Case -12039 To -11868: pinyin = 'xuan ' Case -11867 To -11862: pinyin = 'xue ' Case -11861 To -11848: pinyin = 'xun ' Case -11847 To -11832: pinyin = 'ya ' Case -11831 To -11799: pinyin = 'yan ' Case -11798 To -11782: pinyin = 'yang ' Case -11781 To -11605: pinyin = 'yao ' Case -11604 To -11590: pinyin = 'ye ' Case -11589 To -11537: pinyin = 'yi ' Case -11536 To -11359: pinyin = 'yin ' Case -11358 To -11341: pinyin = 'ying 'Case -11339 To -11325: pinyin = 'yong ' Case -11324 To -11304: pinyin = 'you ' Case -11303 To -11098: pinyin = 'yu ' Case -11097 To -11078: pinyin = 'yuan ' Case -11077 To -11068: pinyin = 'yue ' Case -11067 To -11056: pinyin = 'yun ' Case -11055 To -11053: pinyin = 'za ' Case -11052 To -11046: pinyin = 'zai ' Case -11045 To -11042: pinyin = 'zan ' Case -11041 To -11039: pinyin = 'zang ' Case -11038 To -11025: pinyin = 'zao ' Case -11024 To -11021: pinyin = 'ze ' Case -11020 To -11020: pinyin = 'zei ' Case -11019 To -11019: pinyin = 'zen ' Case -11018 To -11015: pinyin = 'zeng ' Case -11014 To -10839: pinyin = 'zha ' Case -10838 To -10833: pinyin = 'zhai ' Case -10832 To -10816: pinyin = 'zhan ' Case -10815 To -10801: pinyin = 'zhang ' Case -10800 To -10791: pinyin = 'zhao ' Case -10790 To -10781: pinyin = 'zhe ' Case -10780 To -10765: pinyin = 'zhen ' Case -10764 To -10588: pinyin = 'zheng ' Case -10587 To -10545: pinyin = 'zhi ' Case -10544 To -10534: pinyin = 'zhong ' Case -10533 To -10520: pinyin = 'zhou ' Case -10519 To -10332: pinyin = 'zhu ' Case -10331 To -10330: pinyin = 'zhua ' Case -10329 To -10329: pinyin = 'zhuai 'Case -10328 To -10323: pinyin = 'zhuan ' Case -10322 To -10316: pinyin = 'zhuang ' Case -10315 To -10310: pinyin = 'zhui ' Case -10309 To -10308: pinyin = 'zhun ' Case -10307 To -10297: pinyin = 'zhuo ' Case -10296 To -10282: pinyin = 'zi ' Case -10281 To -10275: pinyin = 'zong ' Case -10274 To -10271: pinyin = 'zou ' Case -10270 To -10263: pinyin = 'zu ' Case -10262 To -10261: pinyin = 'zuan ' Case -10260 To -10257: pinyin = 'zui ' Case -10256 To -10255: pinyin = 'zun ' Case -10254 To -10254: pinyin = 'zuo ' Case Else: pinyin = pEnd SelectEnd FunctionFunction getpy(str)For i = 1 To Len(str)getpy = getpy & pinyin(Mid(str, i, 1)) Next iEnd Function第六步,输入拼音转换函数。
excel-汉字转换成拼音简拼(只取首字母)
名字转换为首字母(VBA自定义函数)1、打开EXCEL2、按 ALT+F11 ,点击插入-插入模块,在右面窗口中粘贴下面代码,直接关闭窗口3、输入公式=hztopy(A1),填充所有单元格4、选中所有缩写,复制-选择性粘贴-数值(因为是自定义函数,只有在当前文件中可以显示结果,其他电脑因没有公式而显示错误)5、使用条件格式,检索出含有汉字的单元格:先点中一个单元格(设为D5),条件格式-新建格式规则-使用公式确定要设置格式的单元格:在下面对话框中输入公式 =LENB(D5)>LEN(D5),自己设置格式,确定后退出,再把该单元格的格式用格式刷刷所有单元格。
有汉字的出现所设格式6、选择自定义排序-排序依据“单元格颜色”-次序“无单元格颜色”“在底端”-确定。
7、将汉字手动改写为相应的字母。
8、核对多音字。
注:以上方法只可以在当前文件夹使用,如何将宏保存,使自定义函数可以在所有文件夹中使用1、新建一个EXCEL2、按 ALT+F11 ,点击插入-插入模块,在右面窗口中粘贴下面代码,直接关闭窗口3、另存为-其他格式-文件名改为宏名称、保存类型选择“EXCEL加载宏(*,xlam)”,文件将自动保存在C:\Users\111\AppData\Roaming\Microsoft\AddIns文件夹。
4、打开需要工作的EXLEL,点击开始-EXCEL选项-加载项-转到(G)...-选中上面保存的宏名称-确定。
这样,在该电脑的所有EXCEL中,都可以直接使用自定义公式。
代码(只复制星号内的内容)******************************************************************************* Function hztopy(hzpy As String) As StringDim hzstring As String, pystring As StringDim hzpysum As Integer, hzi As Integer, hzpyhex As Integerhzstring = Trim(hzpy)hzpysum = Len(Trim(hzstring))pystring = ""For hzi = 1 To hzpysumhzpyhex = "&H" + Hex(Asc(Mid(hzstring, hzi, 1)))Select Case hzpyhexCase &HB0A1 To &HB0C4: pystring = pystring + "A"Case &HB0C5 To &HB2C0: pystring = pystring + "B"Case &HB2C1 To &HB4ED: pystring = pystring + "C"Case &HB4EE To &HB6E9: pystring = pystring + "D"Case &HB6EA To &HB7A1: pystring = pystring + "E"Case &HB7A2 To &HB8C0: pystring = pystring + "F"Case &HB8C1 To &HB9FD: pystring = pystring + "G"Case &HB9FE To &HBBF6: pystring = pystring + "H"Case &HBBF7 To &HBFA5: pystring = pystring + "J"Case &HBFA6 To &HC0AB: pystring = pystring + "K"Case &HC0AC To &HC2E7: pystring = pystring + "L"Case &HC2E8 To &HC4C2: pystring = pystring + "M"Case &HC4C3 To &HC5B5: pystring = pystring + "N"Case &HC5B6 To &HC5BD: pystring = pystring + "O"Case &HC5BE To &HC6D9: pystring = pystring + "P"Case &HC6DA To &HC8BA: pystring = pystring + "Q"Case &HC8BB To &HC8F5: pystring = pystring + "R"Case &HC8F6 To &HCBF9: pystring = pystring + "S"Case &HCBFA To &HCDD9: pystring = pystring + "T"Case &HEDC5: pystring = pystring + "T"Case &HCDDA To &HCEF3: pystring = pystring + "W"Case &HCEF4 To &HD1B8: pystring = pystring + "X"Case &HD1B9 To &HD4D0: pystring = pystring + "Y"Case &HD4D1 To &HD7F9: pystring = pystring + "Z"Case Elsepystring = pystring + Mid(hzstring, hzi, 1)End SelectNexthztopy = pystringEnd Function*******************************************************************************。
Excel和Word中怎么把汉字转化为拼音【百科全说】
Excel和Word中怎么把汉字转化为拼音【百科全说】我们可以利用Excel和word软件将汉字转换成拼音,具体怎么操作呢?小编为大家解答这个问题。
具体如下:1.1. 第一步,请大家先复制A列内容到WORD里,当我们粘贴时,请点击“只保留文本”这一项。
2.2.第二步,请大家点击选择自己想标注拼音的汉字,然后点击屏幕左上方的“开始”菜单,接着选择“拼音指南”即可。
3.3. 第三步,出现了如图所示的界面。
4.4. 第四步,我们不需要设置太多,请选择【确定】即可,效果如图。
5.5. 第五步,请大家复制拼音和汉字,然后将其粘贴到刚刚EXCEL里的C列即可。
6.6. 最后,请大家在B2中输入=PHONETIC(C2)然后下拉复制公式,就会出现如图所示的结果,操作完成。
7.以上就是Excel和Word中把汉字转化为拼音的方法。
时间:2019-09-24 02:43 / 作者:百科全说WORD中如何输入汉字拼音中的一二三四声?12/09 04:33问题:WORD中如何输入汉字拼音中的一二三四声? 请详细解答说明,谢谢! 解答:选择拼音打字法,然后把光标放在拼音打字标示条最右边的键盘标志上,点右键选择拼音,然后在电脑屏幕上就会出现一个可以打拼音的键盘,在上面点击你要输入的拼音字母就可以了? excel或word中的表格无法复制到ppt中去怎么办?08/14 15:20出现这样的情况,可能存在下面的原因: 1.系统存在问题或OFFICE 软件存在问题: 2.表格过大,导至PPT一页无法全部显示. 解决办法(前题的OFFICE软件和系统软件正常.无故障) 1.重新调整表格尺寸,使之适应PPT页面: 2.在PPT软件中选择"标题和表格"版式,直接里该页面制表.3.在EXCEL或WORD中制一个小表,看是否可以复制到PPT里去.如果可以,证明OFFICE软件没问题,如果不可以你就要考虑重装或修复OFFICE了!在Word中怎么为汉字添加拼音?word汉字加拼音方法02/11 13:46为了满足制作一些特殊需要的文档,除了在word里可以输入中文和英文字符,还可以为中文添加拼音,下面我们一起来看看吧! 1.打开word软件,打开或者新建一篇文档. 2.选中要添加拼音的文字.一次可以选中多个汉字,不必一个一个的进行操作.依次点击“开始”,“拼音指南”. 3.在拼音指南”窗口,依次在表格里输入拼音,因为软件不能不会自动识别汉字导出拼音. 4.更改对齐方式为“居中”,因为上图中字母的间距太大了. 5.偏移量是指汉字与拼音之间的距离是多大,默认0就可以,按自己的要求也可以更改. 6.甚怎么在Excel或者Word中插入自己的签名11/18 21:59有的小伙伴制作了一份报价Word或者Excel文档,为了证明这是自己的报价文件,因此想要插入自己的签名,但是却不知道如何插入,那么小编就来为大家介绍一下吧.具体如下:1. 第一步,我们需要一份属于自己的PNG文件的签名,小编想要在这儿提醒一下,签名的文件一定是PNG格式的矢量图,可以在PS中制作签名.2. 第二步,双击或者右击打开需要的放置签名的文档.3. 第三步,来到下图所示的文档页面后,点击需要插入签名的位置,接着点击页面顶部的插入选项,然后点击箭头所指的图片选项. 4. 第四步,在图片窗口如何在excel或Word中画出斜的波浪线08/06 15:45在word中画出斜波浪线方法: 通过插入--文本框绘制出一个文本框,在文本框中连续按空格,选中空格,添加波浪式的下划线: 通过旋转文本框,使波浪线倾斜: 选中文本框,右键点击,选择设置形状格式,把形状填充和线条颜色都设置为无即可.Word中怎么将繁体字转化为简体字05/23 14:24在网上搜索相关技术文档或者论文材料的时候,经常会遇到一些繁体文档。
excel_汉字转换成拼音简拼(只取首字母)
名字转换为首字母(VBA自定义函数)1、打开EXCEL2、按 ALT+F11 ,点击插入-插入模块,在右面窗口中粘贴下面代码,直接关闭窗口3、输入公式=hztopy(A1),填充所有单元格4、选中所有缩写,复制-选择性粘贴-数值(因为是自定义函数,只有在当前文件中可以显示结果,其他电脑因没有公式而显示错误)5、使用条件格式,检索出含有汉字的单元格:先点中一个单元格(设为D5),条件格式-新建格式规则-使用公式确定要设置格式的单元格:在下面对话框中输入公式 =LENB(D5)>LEN(D5),自己设置格式,确定后退出,再把该单元格的格式用格式刷刷所有单元格。
有汉字的出现所设格式6、选择自定义排序-排序依据“单元格颜色”-次序“无单元格颜色”“在底端”-确定。
7、将汉字手动改写为相应的字母。
8、核对多音字。
注:以上方法只可以在当前文件夹使用,如何将宏保存,使自定义函数可以在所有文件夹中使用1、新建一个EXCEL2、按 ALT+F11 ,点击插入-插入模块,在右面窗口中粘贴下面代码,直接关闭窗口3、另存为-其他格式-文件名改为宏名称、保存类型选择“EXCEL加载宏(*,xlam)”,文件将自动保存在C:\Users\111\AppData\Roaming\Microsoft\AddIns文件夹。
4、打开需要工作的EXLEL,点击开始-EXCEL选项-加载项-转到(G)...-选中上面保存的宏名称-确定。
这样,在该电脑的所有EXCEL中,都可以直接使用自定义公式。
代码(只复制星号内的内容)******************************************************************************* Function hztopy(hzpy As String) As StringDim hzstring As String, pystring As StringDim hzpysum As Integer, hzi As Integer, hzpyhex As Integerhzstring = Trim(hzpy)hzpysum = Len(Trim(hzstring))pystring = ""For hzi = 1 To hzpysumhzpyhex = "&H" + Hex(Asc(Mid(hzstring, hzi, 1)))Select Case hzpyhexCase &HB0A1 To &HB0C4: pystring = pystring + "A"Case &HB0C5 To &HB2C0: pystring = pystring + "B"Case &HB2C1 To &HB4ED: pystring = pystring + "C"Case &HB4EE To &HB6E9: pystring = pystring + "D"Case &HB6EA To &HB7A1: pystring = pystring + "E"Case &HB7A2 To &HB8C0: pystring = pystring + "F"Case &HB8C1 To &HB9FD: pystring = pystring + "G"Case &HB9FE To &HBBF6: pystring = pystring + "H"Case &HBBF7 To &HBFA5: pystring = pystring + "J"Case &HBFA6 To &HC0AB: pystring = pystring + "K"Case &HC0AC To &HC2E7: pystring = pystring + "L"Case &HC2E8 To &HC4C2: pystring = pystring + "M"Case &HC4C3 To &HC5B5: pystring = pystring + "N"Case &HC5B6 To &HC5BD: pystring = pystring + "O"Case &HC5BE To &HC6D9: pystring = pystring + "P"Case &HC6DA To &HC8BA: pystring = pystring + "Q"Case &HC8BB To &HC8F5: pystring = pystring + "R"Case &HC8F6 To &HCBF9: pystring = pystring + "S"Case &HCBFA To &HCDD9: pystring = pystring + "T"Case &HEDC5: pystring = pystring + "T"Case &HCDDA To &HCEF3: pystring = pystring + "W"Case &HCEF4 To &HD1B8: pystring = pystring + "X"Case &HD1B9 To &HD4D0: pystring = pystring + "Y"Case &HD4D1 To &HD7F9: pystring = pystring + "Z"Case Elsepystring = pystring + Mid(hzstring, hzi, 1)End SelectNexthztopy = pystringEnd Function*******************************************************************************。
如何使用Excel将中文名转换成拼音
方法一:自定义函数法1.创建一个Excel文件2.打开Excel,点击“文件-选项”。
如下图:3.将“开发工具”调出。
如下图:4.点击“开发工具- Visual Basic”。
如下图:5.右击插入模块,复制代码(在文末)。
如下图:6.保存时候会出来这个选项,都可以,不影响后续。
如下图:7.像普通函数一样,使用即可。
代码:Function pinyin(p As String) As String i = Asc(p)Select Case iCase -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 -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 To -19726: pinyin = "chai " Case -19725 To -19716: pinyin = "chan " Case -19715 To -19541: pinyin = "chang " Case -19540 To -19532: pinyin = "chao " Case -19531 To -19526: pinyin = "che " Case -19525 To -19516: pinyin = "chen " Case -19515 To -19501: pinyin = "cheng " Case -19500 To -19485: pinyin = "chi " Case -19484 To -19480: pinyin = "chong " Case -19479 To -19468: pinyin = "chou " Case -19467 To -19290: pinyin = "chu " Case -19289 To -19289: pinyin = "chuai " Case -19288 To -19282: pinyin = "chuan " Case -19281 To -19276: pinyin = "chuang " Case -19275 To -19271: pinyin = "chui " Case -19270 To -19264: pinyin = "chun " Case -19263 To -19262: pinyin = "chuo " Case -19261 To -19250: pinyin = "ci " Case -19249 To -19244: pinyin = "cong " Case -19243 To -19243: pinyin = "cou " Case -19242 To -19239: pinyin = "cu " Case -19238 To -19236: pinyin = "cuan " Case -19235 To -19228: pinyin = "cui " Case -19227 To -19225: pinyin = "cun " Case -19224 To -19219: pinyin = "cuo " Case -19218 To -19213: pinyin = "da " Case -19212 To -19039: pinyin = "dai " Case -19038 To -19024: pinyin = "dan " Case -19023 To -19019: pinyin = "dang " Case -19018 To -19007: pinyin = "dao " Case -19006 To -19004: pinyin = "de " Case -19003 To -18997: pinyin = "deng " Case -18996 To -18978: pinyin = "di " Case -18977 To -18962: pinyin = "dian "Case -18952 To -18784: pinyin = "die " Case -18783 To -18775: pinyin = "ding " Case -18774 To -18774: pinyin = "diu " Case -18773 To -18527: pinyin = "dong " Case -18526 To -18519: pinyin = "fa " Case -18518 To -18502: pinyin = "fan " Case -18501 To -18491: pinyin = "fang " Case -18490 To -18479: pinyin = "fei " Case -18478 To -18464: pinyin = "fen " Case -18463 To -18449: pinyin = "feng " Case -18448 To -18448: pinyin = "fo " Case -18447 To -18447: pinyin = "fou " Case -18446 To -18240: pinyin = "fu " Case -18239 To -18238: pinyin = "ga " Case -18237 To -18232: pinyin = "gai " Case -18231 To -18221: pinyin = "gan " Case -18220 To -18212: pinyin = "gang " Case -18211 To -18202: pinyin = "gao " Case -18201 To -18185: pinyin = "ge " Case -18184 To -18184: pinyin = "gei " Case -18183 To -18182: pinyin = "gen " Case -18181 To -18013: pinyin = "geng " Case -18012 To -17998: pinyin = "gong " Case -17997 To -17989: pinyin = "gou " Case -17988 To -17971: pinyin = "gu " Case -17970 To -17965: pinyin = "gua " Case -17964 To -17962: pinyin = "guai " Case -17961 To -17951: pinyin = "guan " Case -17950 To -17948: pinyin = "guang " Case -17947 To -17932: pinyin = "gui " Case -17931 To -17929: pinyin = "gun " Case -17928 To -17923: pinyin = "guo " Case -17922 To -17760: pinyin = "ha " Case -17759 To -17753: pinyin = "hai " Case -17752 To -17734: pinyin = "han " Case -17733 To -17731: pinyin = "hang " Case -17730 To -17722: pinyin = "hao " Case -17721 To -17704: pinyin = "he " Case -17703 To -17702: pinyin = "hei " Case -17701 To -17698: pinyin = "hen " Case -17697 To -17693: pinyin = "heng " Case -17692 To -17684: pinyin = "hong " Case -17683 To -17677: pinyin = "hou "Case -17496 To -17488: pinyin = "hua " Case -17487 To -17483: pinyin = "huai " Case -17482 To -17469: pinyin = "huan " Case -17468 To -17455: pinyin = "huang " Case -17454 To -17434: pinyin = "hui " Case -17433 To -17428: pinyin = "hun " Case -17427 To -17418: pinyin = "huo " Case -17417 To -17203: pinyin = "ji " Case -17202 To -17186: pinyin = "jia " Case -17185 To -16984: pinyin = "jian " Case -16983 To -16971: pinyin = "jiang " Case -16970 To -16943: pinyin = "jiao " Case -16942 To -16916: pinyin = "jie " Case -16915 To -16734: pinyin = "jin " Case -16733 To -16709: pinyin = "jing " Case -16708 To -16707: pinyin = "jiong " Case -16706 To -16690: pinyin = "jiu " Case -16689 To -16665: pinyin = "ju " Case -16664 To -16658: pinyin = "juan " Case -16657 To -16648: pinyin = "jue " Case -16647 To -16475: pinyin = "jun " Case -16474 To -16471: pinyin = "ka " Case -16470 To -16466: pinyin = "kai " Case -16465 To -16460: pinyin = "kan " Case -16459 To -16453: pinyin = "kang " Case -16452 To -16449: pinyin = "kao " Case -16448 To -16434: pinyin = "ke " Case -16433 To -16430: pinyin = "ken " Case -16429 To -16428: pinyin = "keng " Case -16427 To -16424: pinyin = "kong " Case -16423 To -16420: pinyin = "kou " Case -16419 To -16413: pinyin = "ku " Case -16412 To -16408: pinyin = "kua " Case -16407 To -16404: pinyin = "kuai " Case -16403 To -16402: pinyin = "kuan " Case -16401 To -16394: pinyin = "kuang " Case -16393 To -16221: pinyin = "kui " Case -16220 To -16217: pinyin = "kun " Case -16216 To -16213: pinyin = "kuo " Case -16212 To -16206: pinyin = "la " Case -16205 To -16203: pinyin = "lai " Case -16202 To -16188: pinyin = "lan " Case -16187 To -16181: pinyin = "lang "Case -16171 To -16170: pinyin = "le " Case -16169 To -16159: pinyin = "lei " Case -16158 To -16156: pinyin = "leng " Case -16155 To -15960: pinyin = "li " Case -15959 To -15959: pinyin = "lia " Case -15958 To -15945: pinyin = "lian " Case -15944 To -15934: pinyin = "liang " Case -15933 To -15921: pinyin = "liao " Case -15920 To -15916: pinyin = "lie " Case -15915 To -15904: pinyin = "lin " Case -15903 To -15890: pinyin = "ling " Case -15889 To -15879: pinyin = "liu " Case -15878 To -15708: pinyin = "long " Case -15707 To -15702: pinyin = "lou " Case -15701 To -15682: pinyin = "lu " Case -15681 To -15668: pinyin = "lv " Case -15667 To -15662: pinyin = "luan " Case -15661 To -15660: pinyin = "lue " Case -15659 To -15653: pinyin = "lun " Case -15652 To -15641: pinyin = "luo " Case -15640 To -15632: pinyin = "ma " Case -15631 To -15626: pinyin = "mai " Case -15625 To -15455: pinyin = "man " Case -15454 To -15449: pinyin = "mang " Case -15448 To -15437: pinyin = "mao " Case -15436 To -15436: pinyin = "me " Case -15435 To -15420: pinyin = "mei " Case -15419 To -15417: pinyin = "men " Case -15416 To -15409: pinyin = "meng " Case -15408 To -15395: pinyin = "mi " Case -15394 To -15386: pinyin = "mian " Case -15385 To -15378: pinyin = "miao " Case -15377 To -15376: pinyin = "mie " Case -15375 To -15370: pinyin = "min " Case -15369 To -15364: pinyin = "ming " Case -15363 To -15363: pinyin = "miu " Case -15362 To -15184: pinyin = "mo " Case -15183 To -15181: pinyin = "mou " Case -15180 To -15166: pinyin = "mu " Case -15165 To -15159: pinyin = "na " Case -15158 To -15154: pinyin = "nai " Case -15153 To -15151: pinyin = "nan " Case -15150 To -15150: pinyin = "nang "Case -15144 To -15144: pinyin = "ne " Case -15143 To -15142: pinyin = "nei " Case -15141 To -15141: pinyin = "nen " Case -15140 To -15140: pinyin = "neng " Case -15139 To -15129: pinyin = "ni " Case -15128 To -15122: pinyin = "nian " Case -15121 To -15120: pinyin = "niang " Case -15119 To -15118: pinyin = "niao " Case -15117 To -15111: pinyin = "nie " Case -15110 To -15110: pinyin = "nin " Case -15109 To -14942: pinyin = "ning " Case -14941 To -14938: pinyin = "niu " Case -14937 To -14934: pinyin = "nong " Case -14933 To -14931: pinyin = "nu " Case -14930 To -14930: pinyin = "nv " Case -14929 To -14929: pinyin = "nuan " Case -14928 To -14927: pinyin = "nue " Case -14926 To -14923: pinyin = "nuo " Case -14922 To -14922: pinyin = "o " Case -14921 To -14915: pinyin = "ou " Case -14914 To -14909: pinyin = "pa " Case -14908 To -14903: pinyin = "pai " Case -14902 To -14895: pinyin = "pan " Case -14894 To -14890: pinyin = "pang " Case -14889 To -14883: pinyin = "pao " Case -14882 To -14874: pinyin = "pei " Case -14873 To -14872: pinyin = "pen " Case -14871 To -14858: pinyin = "peng " Case -14857 To -14679: pinyin = "pi " Case -14678 To -14675: pinyin = "pian " Case -14674 To -14671: pinyin = "piao " Case -14670 To -14669: pinyin = "pie " Case -14668 To -14664: pinyin = "pin " Case -14663 To -14655: pinyin = "ping " Case -14654 To -14646: pinyin = "po " Case -14645 To -14631: pinyin = "pu " Case -14630 To -14595: pinyin = "qi " Case -14594 To -14430: pinyin = "qia " Case -14429 To -14408: pinyin = "qian " Case -14407 To -14400: pinyin = "qiang " Case -14399 To -14385: pinyin = "qiao " Case -14384 To -14380: pinyin = "qie " Case -14379 To -14369: pinyin = "qin "Case -14355 To -14354: pinyin = "qiong " Case -14353 To -14346: pinyin = "qiu " Case -14345 To -14171: pinyin = "qu " Case -14170 To -14160: pinyin = "quan " Case -14159 To -14152: pinyin = "que " Case -14151 To -14150: pinyin = "qun " Case -14149 To -14146: pinyin = "ran " Case -14145 To -14141: pinyin = "rang " Case -14140 To -14138: pinyin = "rao " Case -14137 To -14136: pinyin = "re " Case -14135 To -14126: pinyin = "ren " Case -14125 To -14124: pinyin = "reng " Case -14123 To -14123: pinyin = "ri " Case -14122 To -14113: pinyin = "rong " Case -14112 To -14110: pinyin = "rou " Case -14109 To -14100: pinyin = "ru " Case -14099 To -14098: pinyin = "ruan " Case -14097 To -14095: pinyin = "rui " Case -14094 To -14093: pinyin = "run " Case -14092 To -14091: pinyin = "ruo " Case -14090 To -14088: pinyin = "sa " Case -14087 To -14084: pinyin = "sai " Case -14083 To -13918: pinyin = "san " Case -13917 To -13915: pinyin = "sang " Case -13914 To -13911: pinyin = "sao " Case -13910 To -13908: pinyin = "se " Case -13907 To -13907: pinyin = "sen " Case -13906 To -13906: pinyin = "seng " Case -13905 To -13897: pinyin = "sha " Case -13896 To -13895: pinyin = "shai " Case -13894 To -13879: pinyin = "shan " Case -13878 To -13871: pinyin = "shang " Case -13870 To -13860: pinyin = "shao " Case -13859 To -13848: pinyin = "she " Case -13847 To -13832: pinyin = "shen " Case -13831 To -13659: pinyin = "sheng " Case -13658 To -13612: pinyin = "shi " Case -13611 To -13602: pinyin = "shou " Case -13601 To -13407: pinyin = "shu " Case -13406 To -13405: pinyin = "shua " Case -13404 To -13401: pinyin = "shuai " Case -13400 To -13399: pinyin = "shuan " Case -13398 To -13396: pinyin = "shuang "Case -13391 To -13388: pinyin = "shun " Case -13387 To -13384: pinyin = "shuo " Case -13383 To -13368: pinyin = "si " Case -13367 To -13360: pinyin = "song " Case -13359 To -13357: pinyin = "sou " Case -13356 To -13344: pinyin = "su " Case -13343 To -13341: pinyin = "suan " Case -13340 To -13330: pinyin = "sui " Case -13329 To -13327: pinyin = "sun " Case -13326 To -13319: pinyin = "suo " Case -13318 To -13148: pinyin = "ta " Case -13147 To -13139: pinyin = "tai " Case -13138 To -13121: pinyin = "tan " Case -13120 To -13108: pinyin = "tang " Case -13107 To -13097: pinyin = "tao " Case -13096 To -13096: pinyin = "te " Case -13095 To -13092: pinyin = "teng " Case -13091 To -13077: pinyin = "ti " Case -13076 To -13069: pinyin = "tian " Case -13068 To -13064: pinyin = "tiao " Case -13063 To -13061: pinyin = "tie " Case -13060 To -12889: pinyin = "ting " Case -12888 To -12876: pinyin = "tong " Case -12875 To -12872: pinyin = "tou " Case -12871 To -12861: pinyin = "tu " Case -12860 To -12859: pinyin = "tuan " Case -12858 To -12853: pinyin = "tui " Case -12852 To -12850: pinyin = "tun " Case -12849 To -12839: pinyin = "tuo " Case -12838 To -12832: pinyin = "wa " Case -12831 To -12830: pinyin = "wai " Case -12829 To -12813: pinyin = "wan " Case -12812 To -12803: pinyin = "wang " Case -12802 To -12608: pinyin = "wei " Case -12607 To -12598: pinyin = "wen " Case -12597 To -12595: pinyin = "weng " Case -12594 To -12586: pinyin = "wo " Case -12585 To -12557: pinyin = "wu " Case -12556 To -12360: pinyin = "xi " Case -12359 To -12347: pinyin = "xia " Case -12346 To -12321: pinyin = "xian " Case -12320 To -12301: pinyin = "xiang " Case -12300 To -12121: pinyin = "xiao "Case -12099 To -12090: pinyin = "xin " Case -12089 To -12075: pinyin = "xing " Case -12074 To -12068: pinyin = "xiong " Case -12067 To -12059: pinyin = "xiu " Case -12058 To -12040: pinyin = "xu " Case -12039 To -11868: pinyin = "xuan " Case -11867 To -11862: pinyin = "xue " Case -11861 To -11848: pinyin = "xun " Case -11847 To -11832: pinyin = "ya " Case -11831 To -11799: pinyin = "yan " Case -11798 To -11782: pinyin = "yang " Case -11781 To -11605: pinyin = "yao " Case -11604 To -11590: pinyin = "ye " Case -11589 To -11537: pinyin = "yi " Case -11536 To -11359: pinyin = "yin " Case -11358 To -11341: pinyin = "ying " Case -11340 To -11340: pinyin = "yo " Case -11339 To -11325: pinyin = "yong " Case -11324 To -11304: pinyin = "you " Case -11303 To -11098: pinyin = "yu " Case -11097 To -11078: pinyin = "yuan " Case -11077 To -11068: pinyin = "yue " Case -11067 To -11056: pinyin = "yun " Case -11055 To -11053: pinyin = "za " Case -11052 To -11046: pinyin = "zai " Case -11045 To -11042: pinyin = "zan " Case -11041 To -11039: pinyin = "zang " Case -11038 To -11025: pinyin = "zao " Case -11024 To -11021: pinyin = "ze " Case -11020 To -11020: pinyin = "zei " Case -11019 To -11019: pinyin = "zen " Case -11018 To -11015: pinyin = "zeng " Case -11014 To -10839: pinyin = "zha " Case -10838 To -10833: pinyin = "zhai " Case -10832 To -10816: pinyin = "zhan " Case -10815 To -10801: pinyin = "zhang " Case -10800 To -10791: pinyin = "zhao " Case -10790 To -10781: pinyin = "zhe " Case -10780 To -10765: pinyin = "zhen " Case -10764 To -10588: pinyin = "zheng " Case -10587 To -10545: pinyin = "zhi " Case -10544 To -10534: pinyin = "zhong " Case -10533 To -10520: pinyin = "zhou "Case -10331 To -10330: pinyin = "zhua "Case -10329 To -10329: pinyin = "zhuai "Case -10328 To -10323: pinyin = "zhuan "Case -10322 To -10316: pinyin = "zhuang "Case -10315 To -10310: pinyin = "zhui "Case -10309 To -10308: pinyin = "zhun "Case -10307 To -10297: pinyin = "zhuo "Case -10296 To -10282: pinyin = "zi "Case -10281 To -10275: pinyin = "zong "Case -10274 To -10271: pinyin = "zou "Case -10270 To -10263: pinyin = "zu "Case -10262 To -10261: pinyin = "zuan "Case -10260 To -10257: pinyin = "zui "Case -10256 To -10255: pinyin = "zun "Case -10254 To -10254: pinyin = "zuo "Case Else: pinyin = pEnd SelectEnd FunctionFunction getpy(str) '得到拼音For i = 1 To Len(str)getpy = getpy & pinyin(Mid(str, i, 1))Next iEnd FunctionFunction gets(str) '得到首字母gets = Left(getpy(str), 1)End FunctionFunction getqs(str) '得到全首字母For i = 1 To Len(str)getqs = getqs & Left(pinyin(Mid(str, i, 1)), 1) Next iEnd Function。
excel汉字转全拼音函数
excel汉字转全拼音函数
Excel汉字转全拼音函数
在日常工作中,我们常常会遇到需要将汉字转换为拼音的情况。
例如,在处理数据时,将中文名称转换为拼音可以方便排序和查询。
为了解决这个问题,我们可以在Excel中使用自定义函数来实现汉字转全拼音的功能。
步骤1:创建一个新的模块
首先,打开Excel并创建一个新的工作簿。
然后,按下Alt + F11打开Visual Basic for Applications(VBA)编辑器。
在VBA编辑器中,选择插入>模块,创建一个新的模块。
步骤2:编写函数代码
在新创建的模块中,我们可以编写函数代码来实现汉字转全拼音的功能。
以下是一个简单的示例函数:
```vba
Function HanziToPinyin(str As String) As String
Dim i As Long
Dim chineseChar As String
Dim pinyin As String
For i = 1 To Len(str)
chineseChar = Mid(str, i, 1)
' 如果是汉字,则转换为拼音
If Asc(chineseChar) >= 19968 And Asc(chineseChar) <= 40869 Then
pinyin = pinyin &
Application.WorksheetFunction.VLookup(chineseChar, Range(\。
汉字转拼音公式
将汉字转换为拼音,可以使用以下两种方法:
方法一(使用Office Excel 2007):
1. 打开一个新的Excel文档。
2. 在D2单元格中输入“=getpy(C2)”,然后按回车键确认。
3. 将鼠标放在D2单元格右下角,当出现“+”后,向下拖动鼠标。
4. 这样,姓名一栏所有的汉字都以拼音形式显示了。
5. 如果需要将拼音的首字母变成大写,可以将鼠标标定在E2单元格中,然后输入“=PROPER(D2)”,按回车键确认。
6. 重复步骤3~5,即可将所有汉字转换为拼音。
方法二(使用Word文档和拼音指南功能):
1. 打开一个新的Word文档,并将表格中的员工姓名复制到Word文档中。
2. 按下CTRL+A,选择所有数据,确保整个文档被选中。
3. 在开始选项卡下找到拼音指南,并点击确认。
这样,Word文档中的汉字都会附带上拼音。
4. 将Word文档中的数据全选并复制回到Excel表格的B列中。
5. 在C列中,输入“=PH”,并选择第2个公式,引用B1单元格。
整体公式为:“=PHONETIC(B1)”。
6. 按回车键确认后即可得到转换后的结果。
通过以上方法,您可以轻松地将汉字转换为拼音,并将其导入Excel表格中进行分析和处理。