【WPS单元格】汉字转拼音的方法
昨晚休息的时候,赵 sir发来消息,突然有急事,需要把大批量的单元格汉字名字转换为拼音。迅粗略搜了下百度,发现office Excel 是很方便的,而赵 sir电脑装的是wps。百度了下,发现关于WPS,Excel单元格,汉字转拼音的方法寥寥无几,当然office跟wps实现此功能原理上都是一样的,差别在于有些人可能下载的wps无vba,安装又很难找到对应的版本。故有此文。废话不多说,直接看。
必须带有宏功能的WPS。(具体软件看附件,已全部打包,含视频)。
官网可看到就是该版本。软件安装过程就不说了,傻瓜式下一步。软件打开时需要激活码:9DP6T-9AGWG-KWV33-9MPC8-JDCVF
激活后关闭软件,通过双击桌面图标打开wps,(通过桌面打开是防止部分用户也装了office Excel,导致功能无法实现。本人就是这样,浪费了好一会时间)
该界面下,使用Alt+F11打开VB代码编辑窗口,
点击插入-模块-打开vb编辑窗口。如下图
以下代码复制到窗体中
Function pinyin(p As String) As String i = Asc(p) Select Case i Case - To -: pinyin = "a " Case - To -: pinyin = "ai " Case - To -: pinyin = "an " Case - To -: pinyin = "ang " Case - To -: pinyin = "ao " Case - To -: pinyin = "ba " Case - To -: pinyin = "bai " Case - To -: pinyin = "ban " Case - To -: pinyin = "bang " Case - To -: pinyin = "bao " Case - To -: pinyin = "bei " Case - To -: pinyin = "ben " Case - To -: pinyin = "beng " Case - To -: pinyin = "bi " Case - To -: pinyin = "bian " Case - To -: pinyin = "biao " Case - To -: pinyin = "bie " Case - To -: pinyin = "bin " Case - To -: pinyin = "bing " Case - To -: pinyin = "bo " Case - To -: pinyin = "bu " Case - To -: pinyin = "ca " Case - To -: pinyin = "cai " Case - To -: pinyin = "can " Case - To -: pinyin = "cang " Case - To -: pinyin = "cao " Case - To -: pinyin = "ce " Case - To -: pinyin = "ceng " Case - To -: pinyin = "cha " Case - To -: pinyin = "chai " Case - To -: pinyin = "chan " Case - To -: pinyin = "chang " Case - To -: pinyin = "chao " Case - To -: pinyin = "che " Case - To -: pinyin = "chen " Case - To -: pinyin = "cheng " Case - To -: pinyin = "chi " Case - To -: pinyin = "chong " Case - To -: pinyin = "chou " Case - To -: pinyin = "chu " Case - To -: pinyin = "chuai " Case - To -: pinyin = "chuan " Case - To -: pinyin = "chuang " Case - To -: pinyin = "chui " Case - To -: pinyin = "chun " Case - To -: pinyin = "chuo " Case - To -: pinyin = "ci " Case - To -: pinyin = "cong " Case - To -: pinyin = "cou " Case - To -: pinyin = "cu " Case - To -: pinyin = "cuan " Case - To -: pinyin = "cui " Case - To -: pinyin = "cun " Case - To -: pinyin = "cuo " Case - To -: pinyin = "da " Case - To -: pinyin = "dai " Case - To -: pinyin = "dan " Case - To -: pinyin = "dang " Case - To -: pinyin = "dao " Case - To -: pinyin = "de " Case - To -: pinyin = "deng " Case - To -: pinyin = "di " Case - To -: pinyin = "dian " Case - To -: pinyin = "diao " Case - To -: pinyin = "die " Case - To -: pinyin = "ding " Case - To -: pinyin = "diu " Case - To -: pinyin = "dong " Case - To -: pinyin = "fa " Case - To -: pinyin = "fan " Case - To -: pinyin = "fang " Case - To -: pinyin = "fei " Case - To -: pinyin = "fen " Case - To -: pinyin = "feng " Case - To -: pinyin = "fo " Case - To -: pinyin = "fou " Case - To -: pinyin = "fu " Case - To -: pinyin = "ga " Case - To -: pinyin = "gai " Case - To -: pinyin = "gan " Case - To -: pinyin = "gang " Case - To -: pinyin = "gao " Case - To -: pinyin = "ge " Case - To -: pinyin = "gei " Case - To -: pinyin = "gen " Case - To -: pinyin = "geng " Case - To -: pinyin = "gong " Case - To -: pinyin = "gou " Case - To -: pinyin = "gu " Case - To -: pinyin = "gua " Case - To -: pinyin = "guai " Case - To -: pinyin = "guan " Case - To -: pinyin = "guang " Case - To -: pinyin = "gui " Case - To -: pinyin = "gun " Case - To -: pinyin = "guo " Case - To -: pinyin = "ha " Case - To -: pinyin = "hai " Case - To -: pinyin = "han " Case - To -: pinyin = "hang " Case - To -: pinyin = "hao " Case - To -: pinyin = "he " Case - To -: pinyin = "hei " Case - To -: pinyin = "hen " Case - To -: pinyin = "heng " Case - To -: pinyin = "hong " Case - To -: pinyin = "hou " Case - To -: pinyin = "hu " Case - To -: pinyin = "hua " Case - To -: pinyin = "huai " Case - To -: pinyin = "huan " Case - To -: pinyin = "huang " Case - To -: pinyin = "hui " Case - To -: pinyin = "hun " Case - To -: pinyin = "huo " Case - To -: pinyin = "ji " Case - To -: pinyin = "jia " Case - To -: pinyin = "jian " Case - To -: pinyin = "jiang " Case - To -: pinyin = "jiao " Case - To -: pinyin = "jie " Case - To -: pinyin = "jin " Case - To -: pinyin = "jing " Case - To -: pinyin = "jiong " Case - To -: pinyin = "jiu " Case - To -: pinyin = "ju " Case - To -: pinyin = "juan " Case - To -: pinyin = "jue " Case - To -: pinyin = "jun " Case - To -: pinyin = "ka " Case - To -: pinyin = "kai " Case - To -: pinyin = "kan " Case - To -: pinyin = "kang " Case - To -: pinyin = "kao " Case - To -: pinyin = "ke " Case - To -: pinyin = "ken " Case - To -: pinyin = "keng " Case - To -: pinyin = "kong " Case - To -: pinyin = "kou " Case - To -: pinyin = "ku " Case - To -: pinyin = "kua " Case - To -: pinyin = "kuai " Case - To -: pinyin = "kuan " Case - To -: pinyin = "kuang " Case - To -: pinyin = "kui " Case - To -: pinyin = "kun " Case - To -: pinyin = "kuo " Case - To -: pinyin = "la " Case - To -: pinyin = "lai " Case - To -: pinyin = "lan " Case - To -: pinyin = "lang " Case - To -: pinyin = "lao " Case - To -: pinyin = "le " Case - To -: pinyin = "lei " Case - To -: pinyin = "leng " Case - To -: pinyin = "li " Case - To -: pinyin = "lia " Case - To -: pinyin = "lian " Case - To -: pinyin = "liang " Case - To -: pinyin = "liao " Case - To -: pinyin = "lie " Case - To -: pinyin = "lin " Case - To -: pinyin = "ling " Case - To -: pinyin = "liu " Case - To -: pinyin = "long " Case - To -: pinyin = "lou " Case - To -: pinyin = "lu " Case - To -: pinyin = "lv " Case - To -: pinyin = "luan " Case - To -: pinyin = "lue " Case - To -: pinyin = "lun " Case - To -: pinyin = "luo " Case - To -: pinyin = "ma " Case - To -: pinyin = "mai " Case - To -: pinyin = "man " Case - To -: pinyin = "mang " Case - To -: pinyin = "mao " Case - To -: pinyin = "me " Case - To -: pinyin = "mei " Case - To -: pinyin = "men " Case - To -: pinyin = "meng " Case - To -: pinyin = "mi " Case - To -: pinyin = "mian " Case - To -: pinyin = "miao " Case - To -: pinyin = "mie " Case - To -: pinyin = "min " Case - To -: pinyin = "ming " Case - To -: pinyin = "miu " Case - To -: pinyin = "mo " Case - To -: pinyin = "mou " Case - To -: pinyin = "mu " Case - To -: pinyin = "na " Case - To -: pinyin = "nai " Case - To -: pinyin = "nan " Case - To -: pinyin = "nang " Case - To -: pinyin = "nao " Case - To -: pinyin = "ne " Case - To -: pinyin = "nei " Case - To -: pinyin = "nen " Case - To -: pinyin = "neng " Case - To -: pinyin = "ni " Case - To -: pinyin = "nian " Case - To -: pinyin = "niang " Case - To -: pinyin = "niao " Case - To -: pinyin = "nie " Case - To -: pinyin = "nin " Case - To -: pinyin = "ning " Case - To -: pinyin = "niu " Case - To -: pinyin = "nong " Case - To -: pinyin = "nu " Case - To -: pinyin = "nv " Case - To -: pinyin = "nuan " Case - To -: pinyin = "nue " Case - To -: pinyin = "nuo " Case - To -: pinyin = "o " Case - To -: pinyin = "ou " Case - To -: pinyin = "pa " Case - To -: pinyin = "pai " Case - To -: pinyin = "pan " Case - To -: pinyin = "pang " Case - To -: pinyin = "pao " Case - To -: pinyin = "pei " Case - To -: pinyin = "pen " Case - To -: pinyin = "peng " Case - To -: pinyin = "pi " Case - To -: pinyin = "pian " Case - To -: pinyin = "piao " Case - To -: pinyin = "pie " Case - To -: pinyin = "pin " Case - To -: pinyin = "ping " Case - To -: pinyin = "po " Case - To -: pinyin = "pu " Case - To -: pinyin = "qi " Case - To -: pinyin = "qia " Case - To -: pinyin = "qian " Case - To -: pinyin = "qiang " Case - To -: pinyin = "qiao " Case - To -: pinyin = "qie " Case - To -: pinyin = "qin " Case - To -: pinyin = "qing " Case - To -: pinyin = "qiong " Case - To -: pinyin = "qiu " Case - To -: pinyin = "qu " Case - To -: pinyin = "quan " Case - To -: pinyin = "que " Case - To -: pinyin = "qun " Case - To -: pinyin = "ran " Case - To -: pinyin = "rang " Case - To -: pinyin = "rao " Case - To -: pinyin = "re " Case - To -: pinyin = "ren " Case - To -: pinyin = "reng " Case - To -: pinyin = "ri " Case - To -: pinyin = "rong " Case - To -: pinyin = "rou " Case - To -: pinyin = "ru " Case - To -: pinyin = "ruan " Case - To -: pinyin = "rui " Case - To -: pinyin = "run " Case - To -: pinyin = "ruo " Case - To -: pinyin = "sa " Case - To -: pinyin = "sai " Case - To -: pinyin = "san " Case - To -: pinyin = "sang " Case - To -: pinyin = "sao " Case - To -: pinyin = "se " Case - To -: pinyin = "sen " Case - To -: pinyin = "seng " Case - To -: pinyin = "sha " Case - To -: pinyin = "shai " Case - To -: pinyin = "shan " Case - To -: pinyin = "shang " Case - To -: pinyin = "shao " Case - To -: pinyin = "she " Case - To -: pinyin = "shen " Case - To -: pinyin = "sheng " Case - To -: pinyin = "shi " Case - To -: pinyin = "shou " Case - To -: pinyin = "shu " Case - To -: pinyin = "shua " Case - To -: pinyin = "shuai " Case - To -: pinyin = "shuan " Case - To -: pinyin = "shuang " Case - To -: pinyin = "shui " Case - To -: pinyin = "shun " Case - To -: pinyin = "shuo " Case - To -: pinyin = "si " Case - To -: pinyin = "song " Case - To -: pinyin = "sou " Case - To -: pinyin = "su " Case - To -: pinyin = "suan " Case - To -: pinyin = "sui " Case - To -: pinyin = "sun " Case - To -: pinyin = "suo " Case - To -: pinyin = "ta " Case - To -: pinyin = "tai " Case - To -: pinyin = "tan " Case - To -: pinyin = "tang " Case - To -: pinyin = "tao " Case - To -: pinyin = "te " Case - To -: pinyin = "teng " Case - To -: pinyin = "ti " Case - To -: pinyin = "tian " Case - To -: pinyin = "tiao " Case - To -: pinyin = "tie " Case - To -: pinyin = "ting " Case - To -: pinyin = "tong " Case - To -: pinyin = "tou " Case - To -: pinyin = "tu " Case - To -: pinyin = "tuan " Case - To -: pinyin = "tui " Case - To -: pinyin = "tun " Case - To -: pinyin = "tuo " Case - To -: pinyin = "wa " Case - To -: pinyin = "wai " Case - To -: pinyin = "wan " Case - To -: pinyin = "wang " Case - To -: pinyin = "wei " Case - To -: pinyin = "wen " Case - To -: pinyin = "weng " Case - To -: pinyin = "wo " Case - To -: pinyin = "wu " Case - To -: pinyin = "xi " Case - To -: pinyin = "xia " Case - To -: pinyin = "xian " Case - To -: pinyin = "xiang " Case - To -: pinyin = "xiao " Case - To -: pinyin = "xie " Case - To -: pinyin = "xin " Case - To -: pinyin = "xing " Case - To -: pinyin = "xiong " Case - To -: pinyin = "xiu " Case - To -: pinyin = "xu " Case - To -: pinyin = "xuan " Case - To -: pinyin = "xue " Case - To -: pinyin = "xun " Case - To -: pinyin = "ya " Case - To -: pinyin = "yan " Case - To -: pinyin = "yang " Case - To -: pinyin = "yao " Case - To -: pinyin = "ye " Case - To -: pinyin = "yi " Case - To -: pinyin = "yin " Case - To -: pinyin = "ying " Case - To -: pinyin = "yo " Case - To -: pinyin = "yong " Case - To -: pinyin = "you " Case - To -: pinyin = "yu " Case - To -: pinyin = "yuan " Case - To -: pinyin = "yue " Case - To -: pinyin = "yun " Case - To -: pinyin = "za " Case - To -: pinyin = "zai " Case - To -: pinyin = "zan " Case - To -: pinyin = "zang " Case - To -: pinyin = "zao " Case - To -: pinyin = "ze " Case - To -: pinyin = "zei " Case - To -: pinyin = "zen " Case - To -: pinyin = "zeng " Case - To -: pinyin = "zha " Case - To -: pinyin = "zhai " Case - To -: pinyin = "zhan " Case - To -: pinyin = "zhang " Case - To -: pinyin = "zhao " Case - To -: pinyin = "zhe " Case - To -: pinyin = "zhen " Case - To -: pinyin = "zheng " Case - To -: pinyin = "zhi " Case - To -: pinyin = "zhong " Case - To -: pinyin = "zhou " Case - To -: pinyin = "zhu " Case - To -: pinyin = "zhua " Case - To -: pinyin = "zhuai " Case - To -: pinyin = "zhuan " Case - To -: pinyin = "zhuang " Case - To -: pinyin = "zhui " Case - To -: pinyin = "zhun " Case - To -: pinyin = "zhuo " Case - To -: pinyin = "zi " Case - To -: pinyin = "zong " Case - To -: pinyin = "zou " Case - To -: pinyin = "zu " Case - To -: pinyin = "zuan " Case - To -: pinyin = "zui " Case - To -: pinyin = "zun " Case - To -: pinyin = "zuo " Case Else: pinyin = p End Select End Function Function getpy(str) For i = To Len(str) getpy = getpy & pinyin(Mid(str, i, )) Next i End Function
插入完成后,如下图,快捷键:Alt+Q,关闭VB窗口。即可开始使用公式。
如图
注:可能会出现小部分汉字无法转成功,请检查,目前暂时先手动更改。这方面若有好的建议可以提出。
百度链接:https://pan.baidu.com/s/17cLqusSfTPEv8M9b2MGzlg 密码:kevk
【WPS单元格】汉字转拼音的方法的更多相关文章
- 用NPOI创建Excel、合并单元格、设置单元格样式、边框的方法
本篇文章小编为大家介绍,用NPOI创建Excel.合并单元格.设置单元格样式.边框的方法.需要的朋友参考下 今天在做项目中,遇到使用代码生成具有一定样式的Excel,找了很多资料,最后终于解决了,Ex ...
- [PHP] PHP汉字转拼音的方法
PHP汉字转拼音的方法 代码如下: <?php // 此类是依据ASCII码转换,GB2312库对多音字也无能为力. // GB2312标准共收录6763个汉字,不在范围内的汉字是无法转换,如: ...
- JQuery实现表格的相同单元格合并的三种方法
代码: <!DOCTYPE html> <html> <head> <title>merge.html</title> <meta h ...
- gridView 单元格绑定不同控件方法
1.主要代码: private void Form3_Load(object sender, EventArgs e) { DataTable dt = new DataTable(); dt.Col ...
- 获取合并单元格中值的一个方法POI
private static String getCellValueForMerginRegion(Cell cell) { int rowIdx=cell.getRowIndex(); Sheet ...
- NOPI 锁定Excel单元格不让编辑的方法
简介:原生态纯JavaScript 100大技巧大收集---你值得拥有 http://www.cnblogs.com/xl900912/p/4223629.html 从博客园上看都的关于JS的一些常见 ...
- asp.net使用控件datagrid实现表头单元格合并
合并的要点: 1.datagid的单元格合并原理是table中tr,td的布局实现; 2.合并的时机实在其datagridcreate事件中实现; 3.认识一个对象TableCellCollectio ...
- PHP 汉字转拼音
<?php/** *+------------------------------------------------------ * PHP 汉字转拼音 *+----------------- ...
- selenium获取html的表格单元格数据
获取网页的表格的某个单元格的值,思路: 1.获取表格 2.获取表格的所有行 3.根据某一行获取该行的所有列 4.根据某一列获得该行该列的单元格值 根据以上思路,可以知道,只需要行.列就可以得到单元格的 ...
随机推荐
- hibernate meger
转: 在Hibernate中,有save.persist.savaOrUpdate.merge等方法有插入数据的功能.前三者理解起来较后者容易一些,merge方法从api中的介绍就看以看出它是最复杂的 ...
- java 数组对象的应用
public class Student 2 { 3 // 成员变量 4 private String name; 5 private int age; 6 7 // 构造方法 8 public St ...
- oom killer 详解
一.oom killer理解和日志分析:知识储备 oom killer日志分析,这是前篇,准备一些基础知识 带着问题看: 1.什么是oom killer 是Linux内核设计的一种机制,在内存不足的时 ...
- 工作流学习之--TPFlow数据库分析
一.TPFlow项目数据库表: 1. 流程相关: a. leipi_flow工作流表: b. leipi_flow_process流程步骤表: c. leipi_run_process运行过程表:记录 ...
- 欢迎使用CSDN的markdown编辑器
以下是蒻鞫第一次打开CSDN-markdown编译器的温馨提示,感觉CSDN好贴心,不作任何用途,仅为纪念,若存在违法侵权行为,请联系留言,立即删除. List item 这里写 欢迎使用Markdo ...
- 简记webpack运行报错 Uncaught TypeError: self.postMessage is not a function
说好2017Fix的还是能重现,可能项目的版本比较旧了,简要记录解决办法 1.错误: index.js?bed3:67 Uncaught TypeError: self.postMessage is ...
- mysql 对返回的值是null进行判断和重新赋值
SELECT IFNULL(sum(c.tax_data),) ,IFNULL(SUM(c.fiscal_ret),) FROM corp_tax c WHERE c.industry_id = 使用 ...
- DES算法实现
概述(团队项目) DES是一个分组加密算法,它以64位为分组对数据加密.同时DES也是一个对称算法:加密和解密用的是同一个算法.DES是一个包含16个阶段的"替换–置换"的分组加密 ...
- ngx.shared.DICT.get 详解
ngx.shared.DICT.get 原文: ngx.shared.DICT.get syntax: value, flags = ngx.shared.DICT:get(key) context: ...
- Selenium: 利用select模块操作下拉框
在利用selenium进行UI自动化测试过程中,经常会遇到下拉框选项,这篇博客,就介绍下如何利用selenium的Select模块来对标准select下拉框进行操作... 首先导入Select模块: ...