Open excel and add a module.
Function Pinyin (Hz is a string)
Dim PinMa as a string
Dim MyPinMa as a variant
Dim Temp is an integer, I is an integer and J is an integer.
PinMa = "a,203 19,ai,203 17,an,20304,ang,20295,ao,20292,"
Pinma "Ba, 20283, Bai, 20265, Ban, 20257, Bang, 20242, Bao, 20230, Bei, 2005 1, Ben, 20036, Beng, 20032, Bi, 20026, Bian, 20026.
Pinma "ca, 19775, Cai, 19774, can, 19763, Cang, 19756, Cao, 1975 1, ce,.
Pinma "Da, 192 18, Dai, 192 12, Dan, 19038, Dang, 19023, Dao,1.
Pinma e, 187 10,en, 18697,er, 18696
Pinma "Method, 18526, Fan, 185 18, Fang, 1850 1, Fei, 18490, Fen,1.
Pinma "Ga, 18239, Gai, 18237, Gan, 1823 1, Gang, 18220, Gao,182/kloc-0.
Pinma "Ha, 17922, Hai, 17759, Han, 17752, Hang, 17733, Hao, 17730, He,1.
Pinma "Ji, 174 17, Jia, 17202, Jian, 17 185, Jiang, 16983, Jiao,1.
Pinma “ka, 16474,kai, 16470,kan, 16465,kang, 16459,kao, 16452,ke, 16448,ken, 16433,keng, 16429,kong, 16427
Pinma "La, 162 12, Lai, 16205, Lan, 16202, Lang, 16 16687, Lao,/kloc-0.
Pinma "Ma, 15640, Mei, 1563 1, Male, 15625, Meng, 15454, Mao, 15448, Me.
Pinma "So, 15 165, Nai, 15 158, Nan, 15 153, Capsule,15/kloc-0.
Pinma o, 14922,ou, 1492 1
Pinma “pa, 149 14,pai, 14908,pan, 14902,pang, 14894,pao, 14889,pei, 14882,pen, 14876,5438+0,pi
Pinma "Qi, 14630, Qi, 14594, Qian, 14429, Zhang, 14407, Joe, 14399, Qin,1.
Pinma "Ran, 14 149, Jean, 14 145, Rao, 14 140, Hot,14/kloc-0.
Pinma "Sa, 14090, Sai, 14087, Sang, 14083, Sang, 139 17, Sao,139/kloc-.
Pinma "ta, 133 108, tai, 13 147, tan,13/38, teng,13/kloc-.
Pinma "Wa, 12838, Wei, 1283 1, Wan, 12829, Wang, 128 12, Wei,1.
Pinma ",12556, Xia, 12359, Xian, 12346, Item, 12320, Xiao, 12300, Xie,/kloc-"
Pinma "Ya, 1 1847, Yan, 1 183 1, Yang, 1 1798, Yao,1/kloc.
Pinma “za, 1 1055,zai, 1 1052,zan, 1 1045,zang, 1 104 1,zao, 1 1038,ze, 1 1024
MyPinMa = Split(PinMa,",")
For i = 1 to Len(Hz)
Temp = Asc(Mid(Hz,I, 1))
If the temperature < 0.
Temperature = absolute temperature
For j = 79 1 to 1 step 2.
If the temperature < = val (mypinma (j)) and then
Pinyin = pinyin. Mai pingma (j-1) and ""
Quit for ...
If ... it will be over.
then
If ... it will be over.
then
Pinyin = Trim (Pinyin)
End function
The above phonetic code table is obtained from some online tools, and its accuracy has not been fully verified. I hope there is no mistake! As for the algorithm, the comparison between ASC code and code table is a bit ugly. In use, it is found that the code table above is limited to GB23 12-80 I Chinese characters.
Then enter it in any cell.
= Pinyin (a 1)
I converted the Chinese characters in a 1 into pinyin.