这里介绍在excel中把汉字转换成拼音
1、打开要转换成拼音的excel表格
2、按“Alt+F11”组合键,进入Visual Basic编辑状态。也就是看到的这个灰色的编辑界面
3、执行“插入→模块”命令,插入一个新模块。再双击插入的模块,进入模块代码编辑状态;
4、看到如下界面
5、把下面的所有内容复制,粘贴到步骤4中的空白处
复制内容到剪贴板 Functionpinyin(pAsString)AsString i=Asc(p) SelectCasei Case-20319To-20318:pinyin="a" Case-20317To-20305:pinyin="ai" Case-20304To-20296:pinyin="an" Case-20295To-20293:pinyin="ang" Case-20292To-20284:pinyin="ao" Case-20283To-20266:pinyin="ba" Case-20265To-20258:pinyin="bai" Case-20257To-20243:pinyin="ban" Case-20242To-20231:pinyin="bang" Case-20230To-20052:pinyin="bao" Case-20051To-20037:pinyin="bei" Case-20036To-20033:pinyin="ben" Case-20032To-20027:pinyin="beng" Case-20026To-20003:pinyin="bi" Case-20002To-19991:pinyin="bian" Case-19990To-19987:pinyin="biao" Case-19986To-19983:pinyin="bie" Case-19982To-19977:pinyin="bin" Case-19976To-19806:pinyin="bing" Case-19805To-19785:pinyin="bo" Case-19784To-19776:pinyin="bu" Case-19775To-19775:pinyin="ca" Case-19774To-19764:pinyin="cai" Case-19763To-19757:pinyin="can" Case-19756To-19752:pinyin="cang" Case-19751To-19747:pinyin="cao" Case-19746To-19742:pinyin="ce" Case-19741To-19740:pinyin="ceng" Case-19739To-19729:pinyin="cha" Case-19728To-19726:pinyin="chai" Case-19725To-19716:pinyin="chan" Case-19715To-19541:pinyin="chang" Case-19540To-19532:pinyin="chao" Case-19531To-19526:pinyin="che" Case-19525To-19516:pinyin="chen" Case-19515To-19501:pinyin="cheng" Case-19500To-19485:pinyin="chi" Case-19484To-19480:pinyin="chong" Case-19479To-19468:pinyin="chou" Case-19467To-19290:pinyin="chu" Case-19289To-19289:pinyin="chuai" Case-19288To-19282:pinyin="chuan" Case-19281To-19276:pinyin="chuang" Case-19275To-19271:pinyin="chui" Case-19270To-19264:pinyin="chun" Case-19263To-19262:pinyin="chuo" Case-19261To-19250:pinyin="ci" Case-19249To-19244:pinyin="cong" Case-19243To-19243:pinyin="cou" Case-19242To-19239:pinyin="cu" Case-19238To-19236:pinyin="cuan" Case-19235To-19228:pinyin="cui" Case-19227To-19225:pinyin="cun" Case-19224To-19219:pinyin="cuo" Case-19218To-19213:pinyin="da" Case-19212To-19039:pinyin="dai" Case-19038To-19024:pinyin="dan" Case-19023To-19019:pinyin="dang" Case-19018To-19007:pinyin="dao" Case-19006To-19004:pinyin="de" Case-19003To-18997:pinyin="deng" Case-18996To-18978:pinyin="di" Case-18977To-18962:pinyin="dian" Case-18961To-18953:pinyin="diao" Case-18952To-18784:pinyin="die" Case-18783To-18775:pinyin="ding" Case-18774To-18774:pinyin="diu" Case-18773To-18527:pinyin="dong" Case-18526To-18519:pinyin="fa" Case-18518To-18502:pinyin="fan" Case-18501To-18491:pinyin="fang" Case-18490To-18479:pinyin="fei" Case-18478To-18464:pinyin="fen" Case-18463To-18449:pinyin="feng" Case-18448To-18448:pinyin="fo" Case-18447To-18447:pinyin="fou" Case-18446To-18240:pinyin="fu" Case-18239To-18238:pinyin="ga" Case-18237To-18232:pinyin="gai" Case-18231To-18221:pinyin="gan" Case-18220To-18212:pinyin="gang" Case-18211To-18202:pinyin="gao" Case-18201To-18185:pinyin="ge" Case-18184To-18184:pinyin="gei" Case-18183To-18182:pinyin="gen" Case-18181To-18013:pinyin="geng" Case-18012To-17998:pinyin="gong" Case-17997To-17989:pinyin="gou" Case-17988To-17971:pinyin="gu" Case-17970To-17965:pinyin="gua" Case-17964To-17962:pinyin="guai" Case-17961To-17951:pinyin="guan" Case-17950To-17948:pinyin="guang" Case-17947To-17932:pinyin="gui" Case-17931To-17929:pinyin="gun" Case-17928To-17923:pinyin="guo" Case-17922To-17760:pinyin="ha" Case-17759To-17753:pinyin="hai" Case-17752To-17734:pinyin="han" Case-17733To-17731:pinyin="hang" Case-17730To-17722:pinyin="hao" Case-17721To-17704:pinyin="he" Case-17703To-17702:pinyin="hei" Case-17701To-17698:pinyin="hen" Case-17697To-17693:pinyin="heng" Case-17692To-17684:pinyin="hong" Case-17683To-17677:pinyin="hou" Case-17676To-17497:pinyin="hu" Case-17496To-17488:pinyin="hua" Case-17487To-17483:pinyin="huai" Case-17482To-17469:pinyin="huan" Case-17468To-17455:pinyin="huang" Case-17454To-17434:pinyin="hui" Case-17433To-17428:pinyin="hun" Case-17427To-17418:pinyin="huo" Case-17417To-17203:pinyin="ji" Case-17202To-17186:pinyin="jia" Case-17185To-16984:pinyin="jian" Case-16983To-16971:pinyin="jiang" Case-16970To-16943:pinyin="jiao" Case-16942To-16916:pinyin="jie" Case-16915To-16734:pinyin="jin" Case-16733To-16709:pinyin="jing" Case-16708To-16707:pinyin="jiong" Case-16706To-16690:pinyin="jiu" Case-16689To-16665:pinyin="ju" Case-16664To-16658:pinyin="juan" Case-16657To-16648:pinyin="jue" Case-16647To-16475:pinyin="jun" Case-16474To-16471:pinyin="ka" Case-16470To-16466:pinyin="kai" Case-16465To-16460:pinyin="kan" Case-16459To-16453:pinyin="kang" Case-16452To-16449:pinyin="kao" Case-16448To-16434:pinyin="ke" Case-16433To-16430:pinyin="ken" Case-16429To-16428:pinyin="keng" Case-16427To-16424:pinyin="kong" Case-16423To-16420:pinyin="kou" Case-16419To-16413:pinyin="ku" Case-16412To-16408:pinyin="kua" Case-16407To-16404:pinyin="kuai" Case-16403To-16402:pinyin="kuan" Case-16401To-16394:pinyin="kuang" Case-16393To-16221:pinyin="kui" Case-16220To-16217:pinyin="kun" Case-16216To-16213:pinyin="kuo" Case-16212To-16206:pinyin="la" Case-16205To-16203:pinyin="lai" Case-16202To-16188:pinyin="lan" Case-16187To-16181:pinyin="lang" Case-16180To-16172:pinyin="lao" Case-16171To-16170:pinyin="le" Case-16169To-16159:pinyin="lei" Case-16158To-16156:pinyin="leng" Case-16155To-15960:pinyin="li" Case-15959To-15959:pinyin="lia" Case-15958To-15945:pinyin="lian" Case-15944To-15934:pinyin="liang" Case-15933To-15921:pinyin="liao" Case-15920To-15916:pinyin="lie" Case-15915To-15904:pinyin="lin" Case-15903To-15890:pinyin="ling" Case-15889To-15879:pinyin="liu" Case-15878To-15708:pinyin="long" Case-15707To-15702:pinyin="lou" Case-15701To-15682:pinyin="lu" Case-15681To-15668:pinyin="lv" Case-15667To-15662:pinyin="luan" Case-15661To-15660:pinyin="lue" Case-15659To-15653:pinyin="lun" Case-15652To-15641:pinyin="luo" Case-15640To-15632:pinyin="ma" Case-15631To-15626:pinyin="mai" Case-15625To-15455:pinyin="man" Case-15454To-15449:pinyin="mang" Case-15448To-15437:pinyin="mao" Case-15436To-15436:pinyin="me" Case-15435To-15420:pinyin="mei" Case-15419To-15417:pinyin="men" Case-15416To-15409:pinyin="meng" Case-15408To-15395:pinyin="mi" Case-15394To-15386:pinyin="mian" Case-15385To-15378:pinyin="miao" Case-15377To-15376:pinyin="mie" Case-15375To-15370:pinyin="min" Case-15369To-15364:pinyin="ming" Case-15363To-15363:pinyin="miu" Case-15362To-15184:pinyin="mo" Case-15183To-15181:pinyin="mou" Case-15180To-15166:pinyin="mu" Case-15165To-15159:pinyin="na" Case-15158To-15154:pinyin="nai" Case-15153To-15151:pinyin="nan" Case-15150To-15150:pinyin="nang" Case-15149To-15145:pinyin="nao" Case-15144To-15144:pinyin="ne" Case-15143To-15142:pinyin="nei" Case-15141To-15141:pinyin="nen" Case-15140To-15140:pinyin="neng" Case-15139To-15129:pinyin="ni" Case-15128To-15122:pinyin="nian" Case-15121To-15120:pinyin="niang" Case-15119To-15118:pinyin="niao" Case-15117To-15111:pinyin="nie" Case-15110To-15110:pinyin="nin" Case-15109To-14942:pinyin="ning" Case-14941To-14938:pinyin="niu" Case-14937To-14934:pinyin="nong" Case-14933To-14931:pinyin="nu" Case-14930To-14930:pinyin="nv" Case-14929To-14929:pinyin="nuan" Case-14928To-14927:pinyin="nue" Case-14926To-14923:pinyin="nuo" Case-14922To-14922:pinyin="o" Case-14921To-14915:pinyin="ou" Case-14914To-14909:pinyin="pa" Case-14908To-14903:pinyin="pai" Case-14902To-14895:pinyin="pan" Case-14894To-14890:pinyin="pang" Case-14889To-14883:pinyin="pao" Case-14882To-14874:pinyin="pei" Case-14873To-14872:pinyin="pen" Case-14871To-14858:pinyin="peng" Case-14857To-14679:pinyin="pi" Case-14678To-14675:pinyin="pian" Case-14674To-14671:pinyin="piao" Case-14670To-14669:pinyin="pie" Case-14668To-14664:pinyin="pin" Case-14663To-14655:pinyin="ping" Case-14654To-14646:pinyin="po" Case-14645To-14631:pinyin="pu" Case-14630To-14595:pinyin="qi" Case-14594To-14430:pinyin="qia" Case-14429To-14408:pinyin="qian" Case-14407To-14400:pinyin="qiang" Case-14399To-14385:pinyin="qiao" Case-14384To-14380:pinyin="qie" Case-14379To-14369:pinyin="qin" Case-14368To-14356:pinyin="qing" Case-14355To-14354:pinyin="qiong" Case-14353To-14346:pinyin="qiu" Case-14345To-14171:pinyin="qu" Case-14170To-14160:pinyin="quan" Case-14159To-14152:pinyin="que" Case-14151To-14150:pinyin="qun" Case-14149To-14146:pinyin="ran" Case-14145To-14141:pinyin="rang" Case-14140To-14138:pinyin="rao" Case-14137To-14136:pinyin="re" Case-14135To-14126:pinyin="ren" Case-14125To-14124:pinyin="reng" Case-14123To-14123:pinyin="ri" Case-14122To-14113:pinyin="rong" Case-14112To-14110:pinyin="rou" Case-14109To-14100:pinyin="ru" Case-14099To-14098:pinyin="ruan" Case-14097To-14095:pinyin="rui" Case-14094To-14093:pinyin="run" Case-14092To-14091:pinyin="ruo" Case-14090To-14088:pinyin="sa" Case-14087To-14084:pinyin="sai" Case-14083To-13918:pinyin="san" Case-13917To-13915:pinyin="sang" Case-13914To-13911:pinyin="sao" Case-13910To-13908:pinyin="se" Case-13907To-13907:pinyin="sen" Case-13906To-13906:pinyin="seng" Case-13905To-13897:pinyin="sha" Case-13896To-13895:pinyin="shai" Case-13894To-13879:pinyin="shan" Case-13878To-13871:pinyin="shang" Case-13870To-13860:pinyin="shao" Case-13859To-13848:pinyin="she" Case-13847To-13832:pinyin="shen" Case-13831To-13659:pinyin="sheng" Case-13658To-13612:pinyin="shi" Case-13611To-13602:pinyin="shou" Case-13601To-13407:pinyin="shu" Case-13406To-13405:pinyin="shua" Case-13404To-13401:pinyin="shuai" Case-13400To-13399:pinyin="shuan" Case-13398To-13396:pinyin="shuang" Case-13395To-13392:pinyin="shui" Case-13391To-13388:pinyin="shun" Case-13387To-13384:pinyin="shuo" Case-13383To-13368:pinyin="si" Case-13367To-13360:pinyin="song" Case-13359To-13357:pinyin="sou" Case-13356To-13344:pinyin="su" Case-13343To-13341:pinyin="suan" Case-13340To-13330:pinyin="sui" Case-13329To-13327:pinyin="sun" Case-13326To-13319:pinyin="suo" Case-13318To-13148:pinyin="ta" Case-13147To-13139:pinyin="tai" Case-13138To-13121:pinyin="tan" Case-13120To-13108:pinyin="tang" Case-13107To-13097:pinyin="tao" Case-13096To-13096:pinyin="te" Case-13095To-13092:pinyin="teng" Case-13091To-13077:pinyin="ti" Case-13076To-13069:pinyin="tian" Case-13068To-13064:pinyin="tiao" Case-13063To-13061:pinyin="tie" Case-13060To-12889:pinyin="ting" Case-12888To-12876:pinyin="tong" Case-12875To-12872:pinyin="tou" Case-12871To-12861:pinyin="tu" Case-12860To-12859:pinyin="tuan" Case-12858To-12853:pinyin="tui" Case-12852To-12850:pinyin="tun" Case-12849To-12839:pinyin="tuo" Case-12838To-12832:pinyin="wa" Case-12831To-12830:pinyin="wai" Case-12829To-12813:pinyin="wan" Case-12812To-12803:pinyin="wang" Case-12802To-12608:pinyin="wei" Case-12607To-12598:pinyin="wen" Case-12597To-12595:pinyin="weng" Case-12594To-12586:pinyin="wo" Case-12585To-12557:pinyin="wu" Case-12556To-12360:pinyin="xi" Case-12359To-12347:pinyin="xia" Case-12346To-12321:pinyin="xian" Case-12320To-12301:pinyin="xiang" Case-12300To-12121:pinyin="xiao" Case-12120To-12100:pinyin="xie" Case-12099To-12090:pinyin="xin" Case-12089To-12075:pinyin="xing" Case-12074To-12068:pinyin="xiong" Case-12067To-12059:pinyin="xiu" Case-12058To-12040:pinyin="xu" Case-12039To-11868:pinyin="xuan" Case-11867To-11862:pinyin="xue" Case-11861To-11848:pinyin="xun" Case-11847To-11832:pinyin="ya" Case-11831To-11799:pinyin="yan" Case-11798To-11782:pinyin="yang" Case-11781To-11605:pinyin="yao" Case-11604To-11590:pinyin="ye" Case-11589To-11537:pinyin="yi" Case-11536To-11359:pinyin="yin" Case-11358To-11341:pinyin="ying" Case-11340To-11340:pinyin="yo" Case-11339To-11325:pinyin="yong" Case-11324To-11304:pinyin="you" Case-11303To-11098:pinyin="yu" Case-11097To-11078:pinyin="yuan" Case-11077To-11068:pinyin="yue" Case-11067To-11056:pinyin="yun" Case-11055To-11053:pinyin="za" Case-11052To-11046:pinyin="zai" Case-11045To-11042:pinyin="zan" Case-11041To-11039:pinyin="zang" Case-11038To-11025:pinyin="zao" Case-11024To-11021:pinyin="ze" Case-11020To-11020:pinyin="zei" Case-11019To-11019:pinyin="zen" Case-11018To-11015:pinyin="zeng" Case-11014To-10839:pinyin="zha" Case-10838To-10833:pinyin="zhai" Case-10832To-10816:pinyin="zhan" Case-10815To-10801:pinyin="zhang" Case-10800To-10791:pinyin="zhao" Case-10790To-10781:pinyin="zhe" Case-10780To-10765:pinyin="zhen" Case-10764To-10588:pinyin="zheng" Case-10587To-10545:pinyin="zhi" Case-10544To-10534:pinyin="zhong" Case-10533To-10520:pinyin="zhou" Case-10519To-10332:pinyin="zhu" Case-10331To-10330:pinyin="zhua" Case-10329To-10329:pinyin="zhuai" Case-10328To-10323:pinyin="zhuan" Case-10322To-10316:pinyin="zhuang" Case-10315To-10310:pinyin="zhui" Case-10309To-10308:pinyin="zhun" Case-10307To-10297:pinyin="zhuo" Case-10296To-10282:pinyin="zi" Case-10281To-10275:pinyin="zong" Case-10274To-10271:pinyin="zou" Case-10270To-10263:pinyin="zu" Case-10262To-10261:pinyin="zuan" Case-10260To-10257:pinyin="zui" Case-10256To-10255:pinyin="zun" Case-10254To-10254:pinyin="zuo" CaseElse:pinyin=p EndSelect EndFunction Functiongetpy(str) Fori=1ToLen(str) getpy=getpy&pinyin(Mid(str,i,1)) Nexti EndFunction
6、按下ALT+Q关闭Visual Basic编辑窗口,返回Excel编辑状态
7、选中转换后的拼音需要放在哪个列,例如要把B列的第2行的内容转换成拼音,放在D列的第2个单元格,输入公式:=getpy(B2),这里的B2,是指源头单元格的坐标
8、如果要去除拼音之间的空格。去掉空格的拼音放在E列,如果这个未去掉空格的数据原来在D2单元格,去掉空格之后的拼音放在E2单元格,则在E2单元格输入: =SUBSTITUTE(D2," ","")
【excel怎么把汉字转换成拼音?excel实现汉字拼音转换的教程】相关文章: