澳门新萄京官方网站-www.8455.com-澳门新萄京赌场网址

澳门新萄京官方网站:韵脚代码,EXCEL怎么着自动

2019-08-03 作者:办公软件   |   浏览(178)

问题:EXCEL如何自动将人名调换为拼音?

结缘自身另一篇小说,自身树立韵母库。填词用。

 

Function pinyin(p As String) As String

  • 一:视图---->宏---->录制宏

回答:

Function pinyin(p As String) As String

什么是VBA?它有怎么着效果与利益?

i = Asc(p)

澳门新萄京官方网站 1

多谢和讯的特约,大家好,笔者是Excel奇妙之旅,专注于Excel知识和技能的享受

i = Asc(p)

 A.完成Excel中从不落实的职能。

Select Case i

  • 二:试图---->宏---->查看宏

EXCEL怎样自动将人名调换为拼音?以下是自个儿的化解方法,不是用VBA,而是借助word来操作

Select Case i

 B.提升运转速度。

Case -20319 To -20318: pinyin = "1 a "

澳门新萄京官方网站 2

操作思路:

Case -20319 To -20318: pinyin = "a "

 C.编写自定义函数。

Case -20317 To -20305: pinyin = "6 ai "

  • 三:点击编辑,输入如下代码片段,点击保存,并选用是

    Function pinyin(p As String) As String

    i = Asc(p)

    Select Case i

    Case -20319 To -20284: pinyin = "A"

    Case -20283 To -19776: pinyin = "B"

    Case -19775 To -19219: pinyin = "C"

    Case -19218 To -18711: pinyin = "D"

    Case -18710 To -18527: pinyin = "E"

    Case -18526 To -18240: pinyin = "F"

    Case -18239 To -17923: pinyin = "G"

    Case -17922 To -17418: pinyin = "H"

    Case -17417 To -16475: pinyin = "J"

    Case -16474 To -16213: pinyin = "K"

    Case -16212 To -15641: pinyin = "L"

    Case -15640 To -15166: pinyin = "M"

    Case -15165 To -14923: pinyin = "N"

    Case -14922 To -14915: pinyin = "O"

    Case -14914 To -14631: pinyin = "P"

    Case -14630 To -14150: pinyin = "Q"

    Case -14149 To -14091: pinyin = "R"

    Case -14090 To -13319: pinyin = "S"

    Case -13318 To -12839: pinyin = "T"

    Case -12838 To -12557: pinyin = "W"

    Case -12556 To -11848: pinyin = "X"

    Case -11847 To -11056: pinyin = "Y"

    Case -11055 To -2050: pinyin = "Z"

    Case Else: pinyin = p

    End Select

    End Function

    Function getpy(str)

    For i = 1 To Len(str)

    getpy = getpy & pinyin(Mid(str, i, 1))

    Next i

    End Function

率先:把excel中的姓名粘贴到word中,借助word增添拼音,再把word中增添拼音的结果粘贴到excel中

Case -20317 To -20305: pinyin = "ai "

 D.落成自动化成效。

Case -20304 To -20296: pinyin = "10 an "

 

其次:用PHONETIC函数取得拼音

Case -20304 To -20296: pinyin = "an "

 E.通过插入窗体做小型处理软件。

Case -20295 To -20293: pinyin = "12 ang "

澳门新萄京官方网站 3

其三:用substitute函数将拼音声调去掉(这一步视供给,如不须求删除声调能够忽略)

Case -20295 To -20293: pinyin = "ang "

VBA在何地存放的?怎么运作?

Case -20292 To -20284: pinyin = "8 ao "

  • 四:回到excel,**鼠标定位到“拼音码”列第一行(C2单元格)。**在函数框中输入=getpy(B2),(调用自定义函数,获取B2单元格中汉字内容首字母)回车,能够看到获取到B2单元格中内容的首字母

澳门新萄京官方网站 4

Case -20292 To -20284: pinyin = "ao "

 A.模块中

Case -20283 To -20266: pinyin = "1 a "

澳门新萄京官方网站 5

接下去详细介绍操作方法:

Case -20283 To -20266: pinyin = "a "

   在Excel 20第10中学若未有“开采工具”项,通过“文件”——“选项”——“自定义成效区”——选中“开拓工具”——“显明”(图1)。

Case -20265 To -20258: pinyin = "6 ai "

  • 五:鼠标定位到单元格C2右下角,光标产生碳灰十字,按住鼠标左键一向往下拉。获取全部内容的拼音码。

1)第一:把excel中的姓名粘贴到word中,借助word增多拼音,注意粘贴的时候采纳只保留文本那多少个选项,增加拼音后再粘贴回Excel

Case -20265 To -20258: pinyin = "ai "

(注:为了进步word20第10中学插入的图纸的成色,“文件”——“选项”——“高等”——选中“不压缩文件图像品质”——“鲜明”。)

Case -20257 To -20243: pinyin = "10 an "

澳门新萄京官方网站 6

澳门新萄京官方网站 7

Case -20257 To -20243: pinyin = "an "

 

Case -20242 To -20231: pinyin = "12 ang "

 

注意粘贴到Word的时候选用只保留文本那么些选项,不然word不只怕加多拼音

Case -20242 To -20231: pinyin = "ang "

图1 选中“文件”—“选项”

Case -20230 To -20052: pinyin = "8 ao "

澳门新萄京官方网站 8

Case -20230 To -20052: pinyin = "ao "

图2 ”自定义功用区”—“开垦工具”——“鲜明”

Case -20051 To -20037: pinyin = "7 ei "

其次:用PHONETIC函数获得拼音

Case -20051 To -20037: pinyin = "ei "

 

Case -20036 To -20033: pinyin = "11 in "

在C3单元格输入公式= =PHONETIC(B3),然后下拉公式,获得全数人名拼音

Case -20036 To -20033: pinyin = "en "

图3 最后的分界面多出了“开荒工具”选项卡

Case -20032 To -20027: pinyin = "13 eng "

澳门新萄京官方网站 9

Case -20032 To -20027: pinyin = "eng "

 

Case -20026 To -20003: pinyin = "5 i "

其三:用substitute函数将拼音声调去掉(这一步视必要,如无需删除声调可以忽略

Case -20026 To -20003: pinyin = "i "

                                                               图4 代码寄放在“模块”中

Case -20002 To -19991: pinyin = "10 an "

在D3单元格输入公式=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(C3,"ā","a"),"á","a"),"ǎ","a"),"à","a"),"ē","e"),"é","e"),"ě","e"),"è","e"),"ī","i"),"í","i"),"ǐ","i"),"ì","i"),"ō","o"),"ó","o"),"ǒ","o"),"ò","o"),"ū","u"),"ú","u"),"ǔ","u"),"ù","u"),"ǖ","ü"),"ǘ","ü"),"ǚ","ü"),"ǜ","ü")

Case -20002 To -19991: pinyin = "ian "

B.运行宏

Case -19990 To -19987: pinyin = "8 ao "

那些公式利用substitute函数把拼音中的字母为韵母的唱腔都替换来了不带声调的韵母,也就让拼音的腔调去除了

Case -19990 To -19987: pinyin = "iao "

单击向右的绿三角,即能够运营。

Case -19986 To -19983: pinyin = "3 ie "

澳门新萄京官方网站 10

Case -19986 To -19983: pinyin = "ie "

 

Case -19982 To -19977: pinyin = "11 in "

自个儿是Excel玄妙之旅,专注于Excel知识和手艺的分享,关切Excel美妙之旅,带给你越来越多的实战本领

Case -19982 To -19977: pinyin = "in "

   

Case -19976 To -19806: pinyin = "13 eng "

回答:

Case -19976 To -19806: pinyin = "ing "

                                                   图5 右绿三角运转  

Case -19805 To -19785: pinyin = "2 o "

EXCEL怎么样自动将人名转变为拼音?

多谢悟空小秘的特约!

EXCEL怎样自动将人名转变为拼音,由于EXCEL中绝非汉字自动调换拼音的效果与利益,所以要在VBA中自定义贰个转换函数。

具体操作步骤

率先步,要把EXCEL文书档案转变为 XLSM格式,启用宏。

澳门新萄京官方网站 11

第二步,在文件,设置,自定义成效区中勾选开垦工具。

澳门新萄京官方网站 12

第三步,打开VBA编辑器。

澳门新萄京官方网站 13

第四步,插入模块。

澳门新萄京官方网站 14

第五步,在模块中输入如下代码:

Function pinyin(p As String) As String

i = Asc(p)

Select Case i

Case -20319 To -20318: pinyin = "a "

Case -20317 To -20305: pinyin = "ai "

Case -20304 To -20296: pinyin = "an "

Case -20295 To -20293: pinyin = "ang "

Case -20292 To -20284: pinyin = "ao "

Case -20283 To -20266: pinyin = "ba "

Case -20265 To -20258: pinyin = "bai "

Case -20257 To -20243: pinyin = "ban "

Case -20242 To -20231: pinyin = "bang "

Case -20230 To -20052: pinyin = "bao "

Case -20051 To -20037: pinyin = "bei "

Case -20036 To -20033: pinyin = "ben "

Case -20032 To -20027: pinyin = "beng "

Case -20026 To -20003: pinyin = "bi "

Case -20002 To -19991: pinyin = "bian "

Case -19990 To -19987: pinyin = "biao "

Case -19986 To -19983: pinyin = "bie "

Case -19982 To -19977: pinyin = "bin "

Case -19976 To -19806: pinyin = "bing "

Case -19805 To -19785: pinyin = "bo "

Case -19784 To -19776: pinyin = "bu "

Case -19775 To -19775: pinyin = "ca "

Case -19774 To -19764: pinyin = "cai "

Case -19763 To -19757: pinyin = "can "

Case -19756 To -19752: pinyin = "cang "

Case -19751 To -19747: pinyin = "cao "

Case -19746 To -19742: pinyin = "ce "

Case -19741 To -19740: pinyin = "ceng "

Case -19739 To -19729: pinyin = "cha "

Case -19728 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 -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 -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 -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 -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 -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 = p

End Select

End Function

Function getpy(str)

For i = 1 To Len(str)

getpy = getpy & pinyin(Mid(str, i, 1))

Next i

End Function

澳门新萄京官方网站 15

第六步,输入拼音转变函数。

澳门新萄京官方网站 16

高效复制函数完结更改。

澳门新萄京官方网站 17

EXCEL怎么着自动将人名转换为拼音操作演示完结。

Case -19805 To -19785: pinyin = "o "

                                                          图6  选中test并“运行”

Case -19784 To -19776: pinyin = "4 u "

李先生简单介绍:创办计算机械学高校,全职从事Computer教学二十余年。

Case -19784 To -19776: pinyin = "u "

 

Case -19775 To -19775: pinyin = "1 a "

头条号:李先生计算机教学课堂,简单实用,清晰明了,专门系统讲明Computer知识,软件使用技巧,迎接关怀。

回答:

方今用Excel要求使用VBA来达成,操作过于复杂,在小白不懂的情景下,也说不定会有安全性难点。

提出换一种思路,那便是选用网址来成功拼音转换后,再粘贴回Excel中。操作步骤如下:

Case -19775 To -19775: pinyin = "a "

                                                    图7 运维结果

Case -19774 To -19764: pinyin = "6 ai "

打开转变网站

Case -19774 To -19764: pinyin = "ai "

3.怎么是宏?宏和VBA有如何关联?

Case -19763 To -19757: pinyin = "10 an "

操作步骤如下

澳门新萄京官方网站 18

回答:

互连网有相当多用VBA制作而成的自定义函数,寻找下姓名转拼音能够找到非常多的。然后能够像使用普通工作表函数那么采用,生僻字保障持续,但两千常用汉字准确率照旧非常高的

Case -19763 To -19757: pinyin = "an "

 宏(Macro),是一种批量拍卖。

Case -19756 To -19752: pinyin = "12 ang "

Case -19756 To -19752: pinyin = "ang "

 宏常常不只能够录像又能够手动编程,而VBA一般是通过编制程序完成。宏可以和VBA相结合使用。

Case -19751 To -19747: pinyin = "8 ao "

Case -19751 To -19747: pinyin = "ao "

4.摄像三个宏。

Case -19746 To -19742: pinyin = "2 o "

Case -19746 To -19742: pinyin = "e "

  A.“开辟工具”——“录像宏”——宏名叫“输入100”——“录像”——在A1单元格中输入100——“结束”。

Case -19741 To -19740: pinyin = "13 eng "

Case -19741 To -19740: pinyin = "eng "

  B.“宏”——选中“输入100”——“执行”。

Case -19739 To -19729: pinyin = "1 a "

Case -19739 To -19729: pinyin = "a "

  

Case -19728 To -19726: pinyin = "6 ai "

Case -19728 To -19726: pinyin = "ai "

5.编写制定一个宏。

Case -19725 To -19716: pinyin = "10 an "

Case -19725 To -19716: pinyin = "an "

  A.“开辟工具”——“Visual Basic”——“视图”——“工程能源管理器”——“插入”——“模块”——在左手输入代码:

Case -19715 To -19541: pinyin = "12 ang "

Case -19715 To -19541: pinyin = "ang "

   澳门新萄京官方网站 19

Case -19540 To -19532: pinyin = "8 ao "

Case -19540 To -19532: pinyin = "ao "

  B. 单击绿右三角就可以运转。大概关闭VBA编辑窗口,单击“宏”——选中“test”——“施行”。

Case -19531 To -19526: pinyin = "2 o "

Case -19531 To -19526: pinyin = "e "

 

Case -19525 To -19516: pinyin = "11 in "

Case -19525 To -19516: pinyin = "en "

6.VBA语句

Case -19515 To -19501: pinyin = "13 eng "

Case -19515 To -19501: pinyin = "eng "

  A.宏程序语句。

Case -19500 To -19485: pinyin = "14 -i"

Case -19500 To -19485: pinyin = "-i "

   澳门新萄京官方网站 20

Case -19484 To -19480: pinyin = "13 eng "

Case -19484 To -19480: pinyin = "ong "

  B.函数程序语句

Case -19479 To -19468: pinyin = "9 ou "

Case -19479 To -19468: pinyin = "ou "

  澳门新萄京官方网站 21

Case -19467 To -19290: pinyin = "4 u "

Case -19467 To -19290: pinyin = "u "

 C.在程序中应运语句。

Case -19289 To -19289: pinyin = "6 ai "

Case -19289 To -19289: pinyin = "uai "

  澳门新萄京官方网站 22

Case -19288 To -19282: pinyin = "10 an "

Case -19288 To -19282: pinyin = "uan "

D.循环语句。

Case -19281 To -19276: pinyin = "12 ang "

Case -19281 To -19276: pinyin = "uang "

  澳门新萄京官方网站 23

Case -19275 To -19271: pinyin = "7 ei "

Case -19275 To -19271: pinyin = "ui "

7.VBA对象

Case -19270 To -19264: pinyin = "11 in "

Case -19270 To -19264: pinyin = "un "

  A.事业簿对象

Case -19263 To -19262: pinyin = "2 o "

Case -19263 To -19262: pinyin = "uo "

     Workbooks 代表专门的工作簿集结,全数的专门的学问簿,Workbooks(N),表示已开荒的第N个职业簿

Case -19261 To -19250: pinyin = "14 -i"

Case -19261 To -19250: pinyin = "-i "

     Workbooks ("工作簿名称")

Case -19249 To -19244: pinyin = "13 eng "

Case -19249 To -19244: pinyin = "ong "

     ActiveWorkbook 正在操作的职业簿

Case -19243 To -19243: pinyin = "9 ou "

Case -19243 To -19243: pinyin = "ou "

     ThisWorkBook '代码所在的工作簿

Case -19242 To -19239: pinyin = "4 u "

Case -19242 To -19239: pinyin = "u "

  B.专业表对象

Case -19238 To -19236: pinyin = "10 an "

Case -19238 To -19236: pinyin = "uan "

     Sheets("职业表名称")

Case -19235 To -19228: pinyin = "7 ei "

Case -19235 To -19228: pinyin = "ui "

     Sheet1 表示第4个插入的工作表,Sheet2意味第三个插入的办事表....

Case -19227 To -19225: pinyin = "11 in "

Case -19227 To -19225: pinyin = "un "

     Sheets(n) 表示按排列顺序,第n个专门的学业表

Case -19224 To -19219: pinyin = "2 o "

Case -19224 To -19219: pinyin = "uo "

     ActiveSheet 表示活动工作表,光标所在职业表

Case -19218 To -19213: pinyin = "1 a "

Case -19218 To -19213: pinyin = "a "

     worksheet 也意味着工作表,但不包罗图形专门的学问表、宏工作表等。

Case -19212 To -19039: pinyin = "6 ai "

Case -19212 To -19039: pinyin = "ai "

  C.单元格对象

Case -19038 To -19024: pinyin = "10 an "

Case -19038 To -19024: pinyin = "an "

     cells 全体单元格

Case -19023 To -19019: pinyin = "12 ang "

Case -19023 To -19019: pinyin = "ang "

     Range ("单元格地址")

Case -19018 To -19007: pinyin = "8 ao "

Case -19018 To -19007: pinyin = "ao "

     Cells(行数,列数)    Range(“B3”)和Cells(3,2)表示一致的单元格

Case -19006 To -19004: pinyin = "2 o "

Case -19006 To -19004: pinyin = "e "

     Activecell 正在选中或编辑的单元格

Case -19003 To -18997: pinyin = "13 eng "

Case -19003 To -18997: pinyin = "eng "

     Selection 正被选中或选择的单元格或单元格区域

Case -18996 To -18978: pinyin = "5 i "

Case -18996 To -18978: pinyin = "i "

8. VBA属性

Case -18977 To -18962: pinyin = "10 an "

Case -18977 To -18962: pinyin = "ian "

    VBA属性便是VBA对象所享有的特色,表示某些对象的质量如下:对象.属性=属性值

Case -18961 To -18953: pinyin = "8 ao "

Case -18961 To -18953: pinyin = "iao "

    Sub ttt()

Case -18952 To -18784: pinyin = "3 ie "

Case -18952 To -18784: pinyin = "ie "

      Range("a1").Value = 100     ’给单元格a1填充数值100

Case -18783 To -18775: pinyin = "13 eng "

Case -18783 To -18775: pinyin = "ing "

    End Sub

Case -18774 To -18774: pinyin = "9 ou "

Case -18774 To -18774: pinyin = "iu "

                                                                                                                                    

Case -18773 To -18527: pinyin = "13 eng "

Case -18773 To -18527: pinyin = "ong "

    Sub ttt1()

Case -18526 To -18519: pinyin = "1 a "

Case -18526 To -18519: pinyin = "a "

      Sheets(1).Name = "工作表改名了"   ’给办事簿重命名叫“工作表改名了”

Case -18518 To -18502: pinyin = "10 an "

Case -18518 To -18502: pinyin = "an "

    End Sub

Case -18501 To -18491: pinyin = "12 ang "

Case -18501 To -18491: pinyin = "ang "

                                                                                                                                       

Case -18490 To -18479: pinyin = "7 ei "

Case -18490 To -18479: pinyin = "ei "

    Sub ttt2()

Case -18478 To -18464: pinyin = "11 in "

Case -18478 To -18464: pinyin = "en "

       Sheets("Sheet2").Range("a1").Value = "abcd"   ’给sheet2专门的学业表的a1单元格填充字符串“abcd”

Case -18463 To -18449: pinyin = "13 eng "

Case -18463 To -18449: pinyin = "eng "

    End Sub

Case -18448 To -18448: pinyin = "2 o "

Case -18448 To -18448: pinyin = "o "

                                                                                                                                        

Case -18447 To -18447: pinyin = "9 ou "

Case -18447 To -18447: pinyin = "ou "

      Sub ttt3()

Case -18446 To -18240: pinyin = "4 u "

Case -18446 To -18240: pinyin = "u "

     ’单元格的内部的填充色

Case -18239 To -18238: pinyin = "1 a "

Case -18239 To -18238: pinyin = "a "

          Range("A2").Interior.ColorIndex = 3  ’将A2单元格的背景颜色设置为金红

Case -18237 To -18232: pinyin = "6 ai "

Case -18237 To -18232: pinyin = "ai "

         Range("A2").Font.ColorIndex = 3      ’将A2单元格的书体颜色设置为革命

Case -18231 To -18221: pinyin = "10 an "

Case -18231 To -18221: pinyin = "an "

      End Sub

Case -18220 To -18212: pinyin = "12 ang "

Case -18220 To -18212: pinyin = "ang "

                                                                                                                                           

Case -18211 To -18202: pinyin = "8 ao "

Case -18211 To -18202: pinyin = "ao "

9.VBA方法

Case -18201 To -18185: pinyin = "2 o "

Case -18201 To -18185: pinyin = "e "

   VBA方法是职能于VBA对象上的动作,表示用有些方法效果于VBA的指标上,能够用上面包车型地铁格式:

Case -18184 To -18184: pinyin = "7 ei "

Case -18184 To -18184: pinyin = "ei "

   对象.方法  参数名称:=参数值

Case -18183 To -18182: pinyin = "11 in "

Case -18183 To -18182: pinyin = "en "

                                                                                                                                            

Case -18181 To -18013: pinyin = "13 eng "

Case -18181 To -18013: pinyin = "eng "

  Sub ttt4()

Case -18012 To -17998: pinyin = "13 eng "

Case -18012 To -17998: pinyin = "ong "

      ’Range("A1").Copy Destination:= Range("A2")

Case -17997 To -17989: pinyin = "9 ou "

Case -17997 To -17989: pinyin = "ou "

      Range("A1").Copy Range("A2")   ’将A第11中学的内容复制到A2

Case -17988 To -17971: pinyin = "4 u "

Case -17988 To -17971: pinyin = "u "

  End Sub

Case -17970 To -17965: pinyin = "1 a "

Case -17970 To -17965: pinyin = "ua "

                                                                                                                                            

Case -17964 To -17962: pinyin = "6 ai "

Case -17964 To -17962: pinyin = "uai "

  Sub ttt5()

Case -17961 To -17951: pinyin = "10 an "

Case -17961 To -17951: pinyin = "uan "

    Sheet1.Move before:=Sheets("Sheet3")   ’将sheet1表移动到sheet3事先

Case -17950 To -17948: pinyin = "12 ang "

Case -17950 To -17948: pinyin = "uang "

  End Sub

Case -17947 To -17932: pinyin = "7 ei "

Case -17947 To -17932: pinyin = "ui "

                                                                                                                                           

Case -17931 To -17929: pinyin = "11 in "

Case -17931 To -17929: pinyin = "un "

10.在三个乡政党的公文中供给将Excel中二个表格的居民身份证号,配对并填充到另多个表中。宏代码如下:

Case -17928 To -17923: pinyin = "2 o "

Case -17928 To -17923: pinyin = "uo "

     Sub 配对()

Case -17922 To -17760: pinyin = "1 a "

Case -17922 To -17760: pinyin = "a "

      Dim I, J As Integer

Case -17759 To -17753: pinyin = "6 ai "

Case -17759 To -17753: pinyin = "ai "

      For I = 3 To 225

Case -17752 To -17734: pinyin = "10 an "

Case -17752 To -17734: pinyin = "an "

           For J = 4 To 930

Case -17733 To -17731: pinyin = "12 ang "

Case -17733 To -17731: pinyin = "ang "

               If Sheets("Sheet4").Range("b" & I).Value = Sheets("黄门乡").Range("b" & J).Value Then   

Case -17730 To -17722: pinyin = "8 ao "

Case -17730 To -17722: pinyin = "ao "

                     Sheets("Sheet4").Range("e" & I).Value = Sheets("黄门乡").Range("d" & J).Value

Case -17721 To -17704: pinyin = "2 o "

Case -17721 To -17704: pinyin = "e "

              End If

Case -17703 To -17702: pinyin = "7 ei "

Case -17703 To -17702: pinyin = "ei "

         Next J

澳门新萄京官方网站:韵脚代码,EXCEL怎么着自动将姓名调换为拼音。Case -17701 To -17698: pinyin = "11 in "

Case -17701 To -17698: pinyin = "en "

       Next I

Case -17697 To -17693: pinyin = "13 eng "

Case -17697 To -17693: pinyin = "eng "

     End Sub

Case -17692 To -17684: pinyin = "13 eng "

Case -17692 To -17684: pinyin = "ong "

     ’竟然没写入End IF,提醒错误“Next 缺乏 For”

Case -17683 To -17677: pinyin = "9 ou "

Case -17683 To -17677: pinyin = "ou "

11.认清语句

Case -17676 To -17497: pinyin = "4 u "

Case -17676 To -17497: pinyin = "u "

   A.if判定语句

Case -17496 To -17488: pinyin = "1 a "

Case -17496 To -17488: pinyin = "ua "

                                                                                                                           

Case -17487 To -17483: pinyin = "6 ai "

Case -17487 To -17483: pinyin = "uai "

     Sub 决断1() '单条件推断

Case -17482 To -17469: pinyin = "10 an "

Case -17482 To -17469: pinyin = "uan "

       If Range("a1").Value > 0 Then

Case -17468 To -17455: pinyin = "12 ang "

Case -17468 To -17455: pinyin = "uang "

            Range("b1") = "正数"

Case -17454 To -17434: pinyin = "7 ei "

Case -17454 To -17434: pinyin = "ui "

       Else

Case -17433 To -17428: pinyin = "11 in "

Case -17433 To -17428: pinyin = "un "

            Range("b1") = "负数或0"

Case -17427 To -17418: pinyin = "2 o "

Case -17427 To -17418: pinyin = "uo "

       End If

Case -17417 To -17203: pinyin = "5 i "

Case -17417 To -17203: pinyin = "i "

     End Sub

Case -17202 To -17186: pinyin = "1 a "

Case -17202 To -17186: pinyin = "ia "

  B.IIF决断语句

Case -17185 To -16984: pinyin = "10 an "

Case -17185 To -16984: pinyin = "ian "

                                                                                                                            

Case -16983 To -16971: pinyin = "12 ang "

Case -16983 To -16971: pinyin = "iang "

    Sub 判断4()

Case -16970 To -16943: pinyin = "8 ao "

Case -16970 To -16943: pinyin = "iao "

        Range("a3") = IIf(Range("a1") <= 0, "负数或零", "负数")

Case -16942 To -16916: pinyin = "3 ie "

Case -16942 To -16916: pinyin = "ie "

    End Sub

Case -16915 To -16734: pinyin = "11 in "

Case -16915 To -16734: pinyin = "in "

  C.select判断

Case -16733 To -16709: pinyin = "13 eng "

Case -16733 To -16709: pinyin = "ing "

                                                                                                                             

Case -16708 To -16707: pinyin = "13 eng "

Case -16708 To -16707: pinyin = "iong "

    Sub 推断1() '单条件剖断

Case -16706 To -16690: pinyin = "9 ou "

Case -16706 To -16690: pinyin = "iu "

      Select Case Range("a1").Value

Case -16689 To -16665: pinyin = "5 i "

Case -16689 To -16665: pinyin = "v "

      Case Is > 0

Case -16664 To -16658: pinyin = "10 an "

Case -16664 To -16658: pinyin = "uan "

         Range("b1") = "正数"

Case -16657 To -16648: pinyin = "3 ie "

Case -16657 To -16648: pinyin = "ue "

      Case Else

Case -16647 To -16475: pinyin = "11 in "

Case -16647 To -16475: pinyin = "un "

         Range("b1") = "负数或0"

Case -16474 To -16471: pinyin = "1 a "

Case -16474 To -16471: pinyin = "a "

      End Select

Case -16470 To -16466: pinyin = "6 ai "

Case -16470 To -16466: pinyin = "ai "

    End Sub

Case -16465 To -16460: pinyin = "10 an "

Case -16465 To -16460: pinyin = "an "

                                                                                                                               

Case -16459 To -16453: pinyin = "12 ang "

Case -16459 To -16453: pinyin = "ang "

    Sub 决断2() '多规格判别

Case -16452 To -16449: pinyin = "8 ao "

Case -16452 To -16449: pinyin = "ao "

        Select Case Range("a1").Value

Case -16448 To -16434: pinyin = "2 o "

Case -16448 To -16434: pinyin = "e "

         Case Is > 0

Case -16433 To -16430: pinyin = "11 in "

Case -16433 To -16430: pinyin = "en "

           Range("b1") = "正数"

Case -16429 To -16428: pinyin = "13 eng "

Case -16429 To -16428: pinyin = "eng "

         Case Is = 0

Case -16427 To -16424: pinyin = "13 eng "

Case -16427 To -16424: pinyin = "ong "

           Range("b1") = "0"

Case -16423 To -16420: pinyin = "9 ou "

Case -16423 To -16420: pinyin = "ou "

         Case Else

Case -16419 To -16413: pinyin = "4 u "

Case -16419 To -16413: pinyin = "u "

           Range("b1") = "负数"

Case -16412 To -16408: pinyin = "1 a "

Case -16412 To -16408: pinyin = "ua "

         End Select

Case -16407 To -16404: pinyin = "6 ai "

Case -16407 To -16404: pinyin = "uai "

       End Sub

Case -16403 To -16402: pinyin = "10 an "

Case -16403 To -16402: pinyin = "uan "

                                                                                                                                                     

Case -16401 To -16394: pinyin = "12 ang "

Case -16401 To -16394: pinyin = "uang "

      Sub 判断3()

Case -16393 To -16221: pinyin = "7 ei "

Case -16393 To -16221: pinyin = "ui "

         If Range("a3") < "G" Then

Case -16220 To -16217: pinyin = "11 in "

Case -16220 To -16217: pinyin = "un "

            MsgBox "A-G"

Case -16216 To -16213: pinyin = "2 o "

Case -16216 To -16213: pinyin = "uo "

         End If

Case -16212 To -16206: pinyin = "1 a "

Case -16212 To -16206: pinyin = "a "

      End Sub

Case -16205 To -16203: pinyin = "6 ai "

Case -16205 To -16203: pinyin = "ai "

D.区间剖断

Case -16202 To -16188: pinyin = "10 an "

Case -16202 To -16188: pinyin = "an "

                                                                                                                                     

Case -16187 To -16181: pinyin = "12 ang "

Case -16187 To -16181: pinyin = "ang "

  Sub if区间判定()

Case -16180 To -16172: pinyin = "8 ao "

Case -16180 To -16172: pinyin = "ao "

  If Range("a2") <= 1000 Then

Case -16171 To -16170: pinyin = "2 o "

Case -16171 To -16170: pinyin = "e "

    Range("b2") = 0.01

Case -16169 To -16159: pinyin = "7 ei "

Case -16169 To -16159: pinyin = "ei "

  ElseIf Range("a2") <= 3000 Then

Case -16158 To -16156: pinyin = "13 eng "

Case -16158 To -16156: pinyin = "eng "

    Range("b2") = 0.03

Case -16155 To -15960: pinyin = "5 i "

Case -16155 To -15960: pinyin = "i "

  ElseIf Range("a2") > 3000 Then

Case -15959 To -15959: pinyin = "1 a "

Case -15959 To -15959: pinyin = "ia "

    Range("b2") = 0.05

Case -15958 To -15945: pinyin = "10 an "

Case -15958 To -15945: pinyin = "ian "

  End If

Case -15944 To -15934: pinyin = "12 ang "

Case -15944 To -15934: pinyin = "iang "

  End Sub

Case -15933 To -15921: pinyin = "8 ao "

Case -15933 To -15921: pinyin = "iao "

                                                                                                                               

Case -15920 To -15916: pinyin = "3 ie "

Case -15920 To -15916: pinyin = "ie "

Sub select区间剖断()

Case -15915 To -15904: pinyin = "11 in "

Case -15915 To -15904: pinyin = "in "

 Select Case Range("a2").Value

Case -15903 To -15890: pinyin = "13 eng "

Case -15903 To -15890: pinyin = "ing "

 Case 0 To 1000

Case -15889 To -15879: pinyin = "9 ou "

Case -15889 To -15879: pinyin = "iu "

   Range("b2") = 0.01

Case -15878 To -15708: pinyin = "13 eng "

Case -15878 To -15708: pinyin = "ong "

 Case 1001 To 3000

Case -15707 To -15702: pinyin = "9 ou "

Case -15707 To -15702: pinyin = "ou "

   Range("b2") = 0.03

Case -15701 To -15682: pinyin = "4 u "

Case -15701 To -15682: pinyin = "u "

 Case Is > 3000

Case -15681 To -15668: pinyin = "5 i "

Case -15681 To -15668: pinyin = "v "

   Range("b2") = 0.05

Case -15667 To -15662: pinyin = "10 an "

Case -15667 To -15662: pinyin = "uan "

 End Select

Case -15661 To -15660: pinyin = "3 ie "

Case -15661 To -15660: pinyin = "ue "

End Sub

Case -15659 To -15653: pinyin = "11 in "

Case -15659 To -15653: pinyin = "un "

                                                                                                                                  

Case -15652 To -15641: pinyin = "2 o "

Case -15652 To -15641: pinyin = "uo "

12.循环语句

Case -15640 To -15632: pinyin = "1 a "

Case -15640 To -15632: pinyin = "a "

   A.单语句代码

Case -15631 To -15626: pinyin = "6 ai "

Case -15631 To -15626: pinyin = "ai "

     Sub t1()

Case -15625 To -15455: pinyin = "10 an "

Case -15625 To -15455: pinyin = "an "

      Range("d2") = Range("b2") * Range("c2")   ’将b2单元格与c2单元格相乘并赋值给d2单元格

澳门新萄京官方网站:韵脚代码,EXCEL怎么着自动将姓名调换为拼音。Case -15454 To -15449: pinyin = "12 ang "

Case -15454 To -15449: pinyin = "ang "

      Range("d3") = Range("b3") * Range("c3")   ’将b3单元格与c3单元格相乘并赋值给d3单元格

Case -15448 To -15437: pinyin = "8 ao "

Case -15448 To -15437: pinyin = "ao "

      Range("d4") = Range("b4") * Range("c4")   ’将b4单元格与c4单元格相乘并赋值给d4单元格

Case -15436 To -15436: pinyin = "2 o "

Case -15436 To -15436: pinyin = "e "

      Range("d5") = Range("b5") * Range("c5")   ’将b5单元格与c5单元格相乘并赋值给d5单元格

Case -15435 To -15420: pinyin = "7 ei "

Case -15435 To -15420: pinyin = "ei "

      Range("d6") = Range("b6") * Range("c6")   ’将b6单元格与c6单元格相乘并赋值给d6单元格

Case -15419 To -15417: pinyin = "11 in "

Case -15419 To -15417: pinyin = "en "

     End Sub

Case -15416 To -15409: pinyin = "13 eng "

Case -15416 To -15409: pinyin = "eng "

  B.For each 循环语句

Case -15408 To -15395: pinyin = "5 i "

Case -15408 To -15395: pinyin = "i "

    Sub s1()

Case -15394 To -15386: pinyin = "10 an "

Case -15394 To -15386: pinyin = "ian "

      Dim rg As Range

Case -15385 To -15378: pinyin = "8 ao "

Case -15385 To -15378: pinyin = "iao "

      For Each rg In Range("a1:b7,d5:e9")

Case -15377 To -15376: pinyin = "3 ie "

Case -15377 To -15376: pinyin = "ie "

        If rg = "" Then

Case -15375 To -15370: pinyin = "11 in "

Case -15375 To -15370: pinyin = "in "

           rg = 0

Case -15369 To -15364: pinyin = "13 eng "

Case -15369 To -15364: pinyin = "ing "

        End If

Case -15363 To -15363: pinyin = "9 ou "

Case -15363 To -15363: pinyin = "iu "

      Next rg

Case -15362 To -15184: pinyin = "2 o "

Case -15362 To -15184: pinyin = "o "

    End Sub

Case -15183 To -15181: pinyin = "9 ou "

Case -15183 To -15181: pinyin = "ou "

   ’注:在a1到b7单元区域和d5到e9单元格区域中的遍历全部单元格,若为空,就赋值0。

Case -15180 To -15166: pinyin = "4 u "

Case -15180 To -15166: pinyin = "u "

C、For Next语句

Case -15165 To -15159: pinyin = "1 a "

Case -15165 To -15159: pinyin = "a "

   Sub t2()

Case -15158 To -15154: pinyin = "6 ai "

Case -15158 To -15154: pinyin = "ai "

   Dim x As Integer

Case -15153 To -15151: pinyin = "10 an "

Case -15153 To -15151: pinyin = "an "

    For x = 10000 To 2 Step -3

Case -15150 To -15150: pinyin = "12 ang "

Case -15150 To -15150: pinyin = "ang "

     Range("d" & x) = Range("b" & x) * Range("c" & x)

Case -15149 To -15145: pinyin = "8 ao "

Case -15149 To -15145: pinyin = "ao "

    Next x

Case -15144 To -15144: pinyin = "2 o "

Case -15144 To -15144: pinyin = "e "

   End Sub

Case -15143 To -15142: pinyin = "7 ei "

Case -15143 To -15142: pinyin = "ei "

   注:将10000行数据中每隔3行的b列和c列相乘赋值给d列。

Case -15141 To -15141: pinyin = "11 in "

Case -15141 To -15141: pinyin = "en "

D、For Each语句(应用offset方法来制定单元格)

Case -15140 To -15140: pinyin = "13 eng "

Case -15140 To -15140: pinyin = "eng "

   Sub t3()

Case -15139 To -15129: pinyin = "5 i "

Case -15139 To -15129: pinyin = "i "

   Dim rg As Range

Case -15128 To -15122: pinyin = "10 an "

Case -15128 To -15122: pinyin = "ian "

    For Each rg In Range("d2:d18")

Case -15121 To -15120: pinyin = "12 ang "

Case -15121 To -15120: pinyin = "iang "

     rg = rg.Offset(0, -1) * rg.Offset(0, -2)

Case -15119 To -15118: pinyin = "8 ao "

Case -15119 To -15118: pinyin = "iao "

    Next rg

Case -15117 To -15111: pinyin = "3 ie "

Case -15117 To -15111: pinyin = "ie "

   End Sub

Case -15110 To -15110: pinyin = "11 in "

Case -15110 To -15110: pinyin = "in "

   ’注:offset正是偏移,针对d2来讲,Offset(0, -1)指的便是向左移动1个单元格,即c2;而Offset(0, -2)指的就是向左移动2个单元格,即b2;第三个参数是垂直运动,正为升高,负为向下;第一个参数是水平位移,正为向右,负为向左。

Case -15109 To -14942: pinyin = "13 eng "

Case -15109 To -14942: pinyin = "ing "

   

Case -14941 To -14938: pinyin = "9 ou "

Case -14941 To -14938: pinyin = "iu "

                图12 offset函数深入分析图

Case -14937 To -14934: pinyin = "13 eng "

Case -14937 To -14934: pinyin = "ong "

E.Do ……Loop Until语句

Case -14933 To -14931: pinyin = "4 u "

Case -14933 To -14931: pinyin = "u "

   Sub t4()

Case -14930 To -14930: pinyin = "5 i "

Case -14930 To -14930: pinyin = "v "

   Dim x As Integer

Case -14929 To -14929: pinyin = "10 an "

Case -14929 To -14929: pinyin = "uan "

    x = 1

Case -14928 To -14927: pinyin = "3 ie "

Case -14928 To -14927: pinyin = "ue "

    Do

Case -14926 To -14923: pinyin = "2 o "

Case -14926 To -14923: pinyin = "uo "

      x = x 1

Case -14922 To -14922: pinyin = "2 o "

Case -14922 To -14922: pinyin = "o "

      Cells(x, 4) = Cells(x, 2) * Cells(x, 3)

Case -14921 To -14915: pinyin = "9 ou "

Case -14921 To -14915: pinyin = "ou "

    Loop Until x = 18

Case -14914 To -14909: pinyin = "1 a "

Case -14914 To -14909: pinyin = "a "

   End Sub

Case -14908 To -14903: pinyin = "6 ai "

Case -14908 To -14903: pinyin = "ai "

   ’注:Cell(行,列),即上文中的x指的是行。将第二列和第三列相乘赋值给第四列。

Case -14902 To -14895: pinyin = "10 an "

Case -14902 To -14895: pinyin = "an "

F.Do While……Loop语句

Case -14894 To -14890: pinyin = "12 ang "

Case -14894 To -14890: pinyin = "ang "

   Sub t5()

Case -14889 To -14883: pinyin = "8 ao "

Case -14889 To -14883: pinyin = "ao "

    x = 1

Case -14882 To -14874: pinyin = "7 ei "

Case -14882 To -14874: pinyin = "ei "

    Do While x < 18

Case -14873 To -14872: pinyin = "11 in "

Case -14873 To -14872: pinyin = "en "

      x = x 1

Case -14871 To -14858: pinyin = "13 eng "

Case -14871 To -14858: pinyin = "eng "

      Cells(x, 4) = Cells(x, 2) * Cells(x, 3)

Case -14857 To -14679: pinyin = "5 i "

Case -14857 To -14679: pinyin = "i "

    Loop

Case -14678 To -14675: pinyin = "10 an "

Case -14678 To -14675: pinyin = "ian "

   End Sub

Case -14674 To -14671: pinyin = "8 ao "

Case -14674 To -14671: pinyin = "iao "

   ’注:Cell(行,列),即上文中的x指的是行。将第二列和第三列相乘赋值给第四列。

Case -14670 To -14669: pinyin = "3 ie "

Case -14670 To -14669: pinyin = "ie "

G.Do ……Loop Until语句

Case -14668 To -14664: pinyin = "11 in "

Case -14668 To -14664: pinyin = "in "

   Sub s2()

Case -14663 To -14655: pinyin = "13 eng "

Case -14663 To -14655: pinyin = "ing "

    Dim x As Integer

Case -14654 To -14646: pinyin = "2 o "

Case -14654 To -14646: pinyin = "o "

    Do

Case -14645 To -14631: pinyin = "4 u "

Case -14645 To -14631: pinyin = "u "

      x = x 1

Case -14630 To -14595: pinyin = "5 i "

Case -14630 To -14595: pinyin = "i "

      If Cells(x 1, 1) <> Cells(x, 1) 1 Then

Case -14594 To -14430: pinyin = "1 a "

Case -14594 To -14430: pinyin = "ia "

         Cells(x, 2) = "断点"

Case -14429 To -14408: pinyin = "10 an "

Case -14429 To -14408: pinyin = "ian "

         Exit Do

Case -14407 To -14400: pinyin = "12 ang "

Case -14407 To -14400: pinyin = "iang "

      End If

Case -14399 To -14385: pinyin = "8 ao "

Case -14399 To -14385: pinyin = "iao "

    Loop Until x = 14

Case -14384 To -14380: pinyin = "3 ie "

Case -14384 To -14380: pinyin = "ie "

   End Sub

Case -14379 To -14369: pinyin = "11 in "

Case -14379 To -14369: pinyin = "in "

   ’推断第1列中的数据不总是,就在其后的单元格输入一个“断点”。

Case -14368 To -14356: pinyin = "13 eng "

Case -14368 To -14356: pinyin = "ing "

13. 求学变量

Case -14355 To -14354: pinyin = "13 eng "

Case -14355 To -14354: pinyin = "iong "

   A、什么是变量?

Case -14353 To -14346: pinyin = "9 ou "

Case -14353 To -14346: pinyin = "iu "

     所谓变量,便是可变的量。就好象在内部存款和储蓄器中一时寄放的二个小盒子,那么些小盒子放的什么样物体不固定。

Case -14345 To -14171: pinyin = "5 i "

Case -14345 To -14171: pinyin = "v "

     Dim m As Integer

Case -14170 To -14160: pinyin = "10 an "

Case -14170 To -14160: pinyin = "uan "

     Sub t1()

Case -14159 To -14152: pinyin = "3 ie "

Case -14159 To -14152: pinyin = "ue "

       Dim X As Integer 'x正是三个整形变量

Case -14151 To -14150: pinyin = "11 in "

Case -14151 To -14150: pinyin = "un "

       For X = 1 To 10

Case -14149 To -14146: pinyin = "10 an "

Case -14149 To -14146: pinyin = "an "

         Cells(X, 1) = X

Case -14145 To -14141: pinyin = "12 ang "

Case -14145 To -14141: pinyin = "ang "

        Next X

Case -14140 To -14138: pinyin = "8 ao "

Case -14140 To -14138: pinyin = "ao "

      End Sub

Case -14137 To -14136: pinyin = "2 o "

Case -14137 To -14136: pinyin = "e "

   B、小盒子里能够放什么?

Case -14135 To -14126: pinyin = "11 in "

Case -14135 To -14126: pinyin = "en "

 

Case -14125 To -14124: pinyin = "13 eng "

Case -14125 To -14124: pinyin = "eng "

      1、放数字   2、放文本

Case -14123 To -14123: pinyin = "14 -i"

Case -14123 To -14123: pinyin = "-i "

        Sub t2()

Case -14122 To -14113: pinyin = "13 eng "

Case -14122 To -14113: pinyin = "ong "

       Dim st As String    ’st寄存字符串

Case -14112 To -14110: pinyin = "9 ou "

Case -14112 To -14110: pinyin = "ou "

       Dim X As Integer    ’X贮存整数类型

Case -14109 To -14100: pinyin = "4 u "

Case -14109 To -14100: pinyin = "u "

       For X = 1 To 10

Case -14099 To -14098: pinyin = "10 an "

Case -14099 To -14098: pinyin = "uan "

        st = st & "Excel精英培训"

Case -14097 To -14095: pinyin = "7 ei "

Case -14097 To -14095: pinyin = "ui "

       Next X

Case -14094 To -14093: pinyin = "11 in "

Case -14094 To -14093: pinyin = "un "

       End Sub

Case -14092 To -14091: pinyin = "2 o "

Case -14092 To -14091: pinyin = "uo "

     3、 放对象

Case -14090 To -14088: pinyin = "1 a "

Case -14090 To -14088: pinyin = "a "

       Sub t3()

Case -14087 To -14084: pinyin = "6 ai "

Case -14087 To -14084: pinyin = "ai "

        Dim rg As Range      ’rg是单元格类型

Case -14083 To -13918: pinyin = "10 an "

Case -14083 To -13918: pinyin = "an "

         Set rg = Range("a1") ’Set关键词就是给指标变量钦命值

Case -13917 To -13915: pinyin = "12 ang "

Case -13917 To -13915: pinyin = "ang "

          rg = 100

Case -13914 To -13911: pinyin = "8 ao "

Case -13914 To -13911: pinyin = "ao "

        End Sub

Case -13910 To -13908: pinyin = "2 o "

Case -13910 To -13908: pinyin = "e "

    4、 放数组

Case -13907 To -13907: pinyin = "11 in "

Case -13907 To -13907: pinyin = "en "

       Sub t4()

Case -13906 To -13906: pinyin = "13 eng "

Case -13906 To -13906: pinyin = "eng "

          Dim arr(1 To 10) As Integer, X As Integer  

Case -13905 To -13897: pinyin = "1 a "

Case -13905 To -13897: pinyin = "a "

          For X = 1 To 10

Case -13896 To -13895: pinyin = "6 ai "

Case -13896 To -13895: pinyin = "ai "

            arr(X) = X

Case -13894 To -13879: pinyin = "10 an "

Case -13894 To -13879: pinyin = "an "

          Next X

Case -13878 To -13871: pinyin = "12 ang "

Case -13878 To -13871: pinyin = "ang "

       End Sub

Case -13870 To -13860: pinyin = "8 ao "

Case -13870 To -13860: pinyin = "ao "

      ’数组arr(1),arr(2),arr(3)……arr(10)都以整形类型

Case -13859 To -13848: pinyin = "2 o "

Case -13859 To -13848: pinyin = "e "

C、变量的品种和注解

Case -13847 To -13832: pinyin = "11 in "

Case -13847 To -13832: pinyin = "en "

   1 变量的系列

Case -13831 To -13659: pinyin = "13 eng "

Case -13831 To -13659: pinyin = "eng "

     (1)整型(Integer):

Case -13658 To -13612: pinyin = "14 -i"

Case -13658 To -13612: pinyin = "-i "

          表示-32768至32767之内的整数           举例:10   110   20

Case -13611 To -13602: pinyin = "9 ou "

Case -13611 To -13602: pinyin = "ou "

     (2)长整型(Long):

Case -13601 To -13407: pinyin = "4 u "

Case -13601 To -13407: pinyin = "u "

          表示-2,147,483,648至2,147,483,647里头的整数

Case -13406 To -13405: pinyin = "1 a "

Case -13406 To -13405: pinyin = "ua "

           举个例子:长整型的书写:    23454444554     

Case -13404 To -13401: pinyin = "6 ai "

Case -13404 To -13401: pinyin = "uai "

     (3)单精度实型(Single):

Case -13400 To -13399: pinyin = "10 an "

Case -13400 To -13399: pinyin = "uan "

           有效数为7位 表示-3.37E 38至3.37E 38里面包车型客车实数

Case -13398 To -13396: pinyin = "12 ang "

Case -13398 To -13396: pinyin = "uang "

     (4)双精度实型(Double):

Case -13395 To -13392: pinyin = "7 ei "

Case -13395 To -13392: pinyin = "ui "

           有效数为十三位

Case -13391 To -13388: pinyin = "11 in "

Case -13391 To -13388: pinyin = "un "

     (5)字符型(String)

Case -13387 To -13384: pinyin = "2 o "

Case -13387 To -13384: pinyin = "uo "

         在VB中字符串常量是用双引号“ ”括起的一串字符,例 如"ABC","abcdefg","123","0","VB程序设计"等。

Case -13383 To -13368: pinyin ="14 -i"

Case -13383 To -13368: pinyin ="-i "

    (6) 逻辑型(Boolean)

Case -13367 To -13360: pinyin = "13 eng "

Case -13367 To -13360: pinyin = "ong "

         逻辑型又称布尔型,其数额独有True(真)和False(假)八个值

Case -13359 To -13357: pinyin = "9 ou "

Case -13359 To -13357: pinyin = "ou "

    (7)日期型(Date)

Case -13356 To -13344: pinyin = "4 u "

Case -13356 To -13344: pinyin = "u "

         表示日期和岁月

Case -13343 To -13341: pinyin = "10 an "

Case -13343 To -13341: pinyin = "uan "

         用两个“#”符号把日子和岁月的值括起来       如:#08/20/2001#、#2001-08-20#

Case -13340 To -13330: pinyin = "7 ei "

Case -13340 To -13330: pinyin = "ui "

   2 为啥要注明变量

Case -13329 To -13327: pinyin = "11 in "

Case -13329 To -13327: pinyin = "un "

     变量通过索引能够储存越多的值,在循环结构中的功用大。

Case -13326 To -13319: pinyin = "2 o "

Case -13326 To -13319: pinyin = "uo "

   3 申明变量

Case -13318 To -13148: pinyin = "1 a "

Case -13318 To -13148: pinyin = "a "

      dim public

Case -13147 To -13139: pinyin = "6 ai "

Case -13147 To -13139: pinyin = "ai "

D、变量的存活周期

Case -13138 To -13121: pinyin = "10 an "

Case -13138 To -13121: pinyin = "an "

   1 进度级变量:进程停止,变量值释放

Case -13120 To -13108: pinyin = "12 ang "

Case -13120 To -13108: pinyin = "ang "

       '如t1

Case -13107 To -13097: pinyin = "8 ao "

Case -13107 To -13097: pinyin = "ao "

   2 模块级变量:变量的值只在本模块中保障,工作簿关闭时随时释放   

Case -13096 To -13096: pinyin = "2 o "

Case -13096 To -13096: pinyin = "e "

 

Case -13095 To -13092: pinyin = "13 eng "

Case -13095 To -13092: pinyin = "eng "

         Sub t6()

Case -13091 To -13077: pinyin = "5 i "

Case -13091 To -13077: pinyin = "i "

            m = 1

Case -13076 To -13069: pinyin = "10 an "

Case -13076 To -13069: pinyin = "ian "

         End Sub

Case -13068 To -13064: pinyin = "8 ao "

Case -13068 To -13064: pinyin = "iao "

         

Case -13063 To -13061: pinyin = "3 ie "

Case -13063 To -13061: pinyin = "ie "

        Sub t5()

Case -13060 To -12889: pinyin = "13 eng "

Case -13060 To -12889: pinyin = "ing "

          MsgBox m

Case -12888 To -12876: pinyin = "13 eng "

Case -12888 To -12876: pinyin = "ong "

          m = 7

Case -12875 To -12872: pinyin = "9 ou "

Case -12875 To -12872: pinyin = "ou "

         End Sub

Case -12871 To -12861: pinyin = "4 u "

Case -12871 To -12861: pinyin = "u "

 

Case -12860 To -12859: pinyin = "10 an "

Case -12860 To -12859: pinyin = "uan "

   3 全局级变量: 在具备的模块中都能够调用,值会保存到EXCEL关闭时才会被假释。

Case -12858 To -12853: pinyin = "7 ei "

Case -12858 To -12853: pinyin = "ui "

       ' public 变量

Case -12852 To -12850: pinyin = "11 in "

Case -12852 To -12850: pinyin = "un "

         Sub t7()

Case -12849 To -12839: pinyin = "2 o "

Case -12849 To -12839: pinyin = "uo "

           MsgBox qq

Case -12838 To -12832: pinyin = "1 a "

Case -12838 To -12832: pinyin = "a "

         End Sub

Case -12831 To -12830: pinyin = "6 ai "

Case -12831 To -12830: pinyin = "ai "

 E、变量的假释

Case -12829 To -12813: pinyin = "10 an "

Case -12829 To -12813: pinyin = "an "

     一般境况下,进度级变量在经过运营停止后就能自行从内部存款和储蓄器中放出,而唯有一对从外表借用的对象变量才须求运用set 变量=nothing进行自由。

Case -12812 To -12803: pinyin = "12 ang "

Case -12812 To -12803: pinyin = "ang "

14.函数与公式

Case -12802 To -12608: pinyin = "7 ei "

Case -12802 To -12608: pinyin = "ei "

A、用VBA在单元格中输入常见公式

Case -12607 To -12598: pinyin = "11 in "

Case -12607 To -12598: pinyin = "en "

Option Explicit

Case -12597 To -12595: pinyin = "13 eng "

Case -12597 To -12595: pinyin = "eng "

     Sub t1()

Case -12594 To -12586: pinyin = "2 o "

Case -12594 To -12586: pinyin = "o "

       Range("d2") = "=b2*c2"   ’将b2乘以c2赋值给d2

Case -12585 To -12557: pinyin = "4 u "

Case -12585 To -12557: pinyin = "u "

     End Sub

Case -12556 To -12360: pinyin = "5 i "

Case -12556 To -12360: pinyin = "i "

     澳门新萄京官方网站 24

Case -12359 To -12347: pinyin = "1 a "

Case -12359 To -12347: pinyin = "ia "

     Sub t2()

Case -12346 To -12321: pinyin = "10 an "

Case -12346 To -12321: pinyin = "ian "

      Dim x As Integer

Case -12320 To -12301: pinyin = "12 ang "

Case -12320 To -12301: pinyin = "iang "

      For x = 2 To 6

Case -12300 To -12121: pinyin = "8 ao "

Case -12300 To -12121: pinyin = "iao "

       Cells(x, 4) = "=b" & x & "*c" & x     ’将b列乘以c列赋值给d列

Case -12120 To -12100: pinyin = "3 ie "

Case -12120 To -12100: pinyin = "ie "

      Next x

Case -12099 To -12090: pinyin = "11 in "

Case -12099 To -12090: pinyin = "in "

     End Sub

Case -12089 To -12075: pinyin = "13 eng "

Case -12089 To -12075: pinyin = "ing "

     澳门新萄京官方网站 25

Case -12074 To -12068: pinyin = "13 eng "

Case -12074 To -12068: pinyin = "iong "

 

Case -12067 To -12059: pinyin = "9 ou "

Case -12067 To -12059: pinyin = "iu "

B、用VBA在单元格输入带引号的公式

Case -12058 To -12040: pinyin = "5 i "

Case -12058 To -12040: pinyin = "v "

     Sub t3()

Case -12039 To -11868: pinyin = "10 an "

Case -12039 To -11868: pinyin = "uan "

     Range("c16") = "=SUMIF(A2:A6,""b"",B2:B6)" '境遇单引号就把单引号加倍

Case -11867 To -11862: pinyin = "3 ie "

Case -11867 To -11862: pinyin = "ue "

     End Sub

Case -11861 To -11848: pinyin = "11 in "

Case -11861 To -11848: pinyin = "un "

     注:在A2:A6单元格区域中,找到b项,共多少个,将所对应的B列中的单元格值相加,即3 5=8。

Case -11847 To -11832: pinyin = "1 a "

Case -11847 To -11832: pinyin = "a "

      澳门新萄京官方网站 26

Case -11831 To -11799: pinyin = "10 an "

Case -11831 To -11799: pinyin = "an "

C、用VBA在单元格中输入数组公式

Case -11798 To -11782: pinyin = "12 ang "

Case -11798 To -11782: pinyin = "ang "

    Sub t4()

Case -11781 To -11605: pinyin = "8 ao "

Case -11781 To -11605: pinyin = "ao "

      Range("c9").FormulaArray = "=SUM(B2:B6*C2:C6)"

Case -11604 To -11590: pinyin = "3 ie "

Case -11604 To -11590: pinyin = "e "

End Sub

Case -11589 To -11537: pinyin = "5 i "

Case -11589 To -11537: pinyin = "i "

’注:将b列和c列相乘的结果

Case -11536 To -11359: pinyin = "11 in "

Case -11536 To -11359: pinyin = "in "

D、利用单元格公式重返值

Case -11358 To -11341: pinyin = "13 eng "

Case -11358 To -11341: pinyin = "ing "

     Sub t5()

Case -11340 To -11340: pinyin = "2 o "

Case -11340 To -11340: pinyin = "o "

         Range("d16") = Evaluate("=SUMIF(A2:A6,""b"",B2:B6)")

Case -11339 To -11325: pinyin = "13 eng "

Case -11339 To -11325: pinyin = "ong "

         Range("d9") = Evaluate("=SUM(B2:B6*C2:C6)")

Case -11324 To -11304: pinyin = "9 ou "

Case -11324 To -11304: pinyin = "ou "

     End Sub

Case -11303 To -11098: pinyin = "5 i "

Case -11303 To -11098: pinyin = "v "

E、借用工作表函数

Case -11097 To -11078: pinyin = "10 an "

Case -11097 To -11078: pinyin = "uan "

     Sub t6()

Case -11077 To -11068: pinyin = "3 ie "

Case -11077 To -11068: pinyin = "ue "

        Range("d8") = Application.WorksheeFunction.CountIf(Range("A1:A10"), "B")

Case -11067 To -11056: pinyin = "11 in "

Case -11067 To -11056: pinyin = "un "

     End Sub

Case -11055 To -11053: pinyin = "1 a "

Case -11055 To -11053: pinyin = "a "

F、利用VBA函数

Case -11052 To -11046: pinyin = "6 ai "

Case -11052 To -11046: pinyin = "ai "

     Sub t7()

Case -11045 To -11042: pinyin = "10 an "

Case -11045 To -11042: pinyin = "an "

      Range("C20") = VBA.InStr(Range("a20"), "E")

Case -11041 To -11039: pinyin = "12 ang "

Case -11041 To -11039: pinyin = "ang "

     End Sub

Case -11038 To -11025: pinyin = "8 ao "

Case -11038 To -11025: pinyin = "ao "

G、编写自定义函数

Case -11024 To -11021: pinyin = "2 o "

Case -11024 To -11021: pinyin = "e "

      Function wn()

Case -11020 To -11020: pinyin = "7 ei "

Case -11020 To -11020: pinyin = "ei "

         wn = Application.Caller.Parent.Name

Case -11019 To -11019: pinyin = "11 in "

Case -11019 To -11019: pinyin = "en "

      End Function

Case -11018 To -11015: pinyin = "13 eng "

Case -11018 To -11015: pinyin = "eng "

15. VBE编辑器

Case -11014 To -10839: pinyin = "1 a "

Case -11014 To -10839: pinyin = "a "

A、工程窗口

Case -10838 To -10833: pinyin = "6 ai "

Case -10838 To -10833: pinyin = "ai "

    a 出示专业簿职业表对象

Case -10832 To -10816: pinyin = "10 an "

Case -10832 To -10816: pinyin = "an "

    b 窗体

Case -10815 To -10801: pinyin = "12 ang "

Case -10815 To -10801: pinyin = "ang "

    c 模块

Case -10800 To -10791: pinyin = "8 ao "

Case -10800 To -10791: pinyin = "ao "

    d 类模块

Case -10790 To -10781: pinyin = "2 o "

Case -10790 To -10781: pinyin = "e "

range("a1")=10

Case -10780 To -10765: pinyin = "11 in "

Case -10780 To -10765: pinyin = "en "

'对应工程窗口的对象和模板,突显其所具体的一些特点。

Case -10764 To -10588: pinyin = "13 eng "

Case -10764 To -10588: pinyin = "eng "

    

Case -10587 To -10545: pinyin = "14 -i"

Case -10587 To -10545: pinyin = "-i "

B、代码窗口

Case -10544 To -10534: pinyin = "13 eng "

Case -10544 To -10534: pinyin = "ong "

    a 注释文字的设置

Case -10533 To -10520: pinyin = "9 ou "

Case -10533 To -10520: pinyin = "ou "

    b 代码缩进的装置

Case -10519 To -10332: pinyin = "4 u "

Case -10519 To -10332: pinyin = "u "

    c 代码强制转行的安装

Case -10331 To -10330: pinyin = "1 a "

Case -10331 To -10330: pinyin = "ua "

    d 代码运维和调节和测验

Case -10329 To -10329: pinyin = "6 ai "

Case -10329 To -10329: pinyin = "uai "

         '逐句运转

Case -10328 To -10323: pinyin = "10 an "

Case -10328 To -10323: pinyin = "uan "

         '设置断点

Case -10322 To -10316: pinyin = "12 ang "

Case -10322 To -10316: pinyin = "uang "

    e 对象列表框和经过列表框

Case -10315 To -10310: pinyin = "7 ei "

Case -10315 To -10310: pinyin = "ui "

 C、立刻窗口

Case -10309 To -10308: pinyin = "11 in "

Case -10309 To -10308: pinyin = "un "

即时窗口能够把运维进程中的值马上显示出来,首要用来程序的调解

Case -10307 To -10297: pinyin = "2 o "

Case -10307 To -10297: pinyin = "uo "

    Sub d()

Case -10296 To -10282: pinyin = "14 -i"

Case -10296 To -10282: pinyin = "-i "

     Dim x As Integer, st As String

Case -10281 To -10275: pinyin = "13 eng "

Case -10281 To -10275: pinyin = "ong "

     For x = 1 To 10

Case -10274 To -10271: pinyin = "9 ou "

Case -10274 To -10271: pinyin = "ou "

        st = st & Cells(x, 1)

Case -10270 To -10263: pinyin = "4 u "

Case -10270 To -10263: pinyin = "u "

        Debug.Print "第" & x & "次运转结果:" & st

Case -10262 To -10261: pinyin = "10 an "

Case -10262 To -10261: pinyin = "uan "

     Next x

Case -10260 To -10257: pinyin = "7 ei "

Case -10260 To -10257: pinyin = "ui "

    End Sub

Case -10256 To -10255: pinyin = "11 in "

Case -10256 To -10255: pinyin = "un "

 D、本地窗口

Case -10254 To -10254: pinyin = "2 o "

Case -10254 To -10254: pinyin = "uo "

   '在本地窗口中能够显得运维中断时对象音讯、变量值、数组音讯等

Case Else: pinyin = p

Case Else: pinyin = p

   Sub d1()

End Select

End Select

     Dim x As Integer, k As Integer

End Function

End Function

     For x = 1 To 10

Function getyj(str)

Function getym(str)

        k = k Cells(x, 1)

For i = 1 To Len(str)

For i = 1 To Len(str)

     Next x

getyj = getyj & pinyin(Mid(str, i, 1))

getym = getym & pinyin(Mid(str, i, 1))

   End Sub

Next i

Next i

16.VBA分支语句与End语句

End Function

End Function

   

 

 A、END语句

作用:强制退出全部正在运作的次第。

B、 Exit语句:退出钦点的说话

      a、Exit Sub语句

         Sub e1()

             Dim x As Integer

             For x = 1 To 100

                Cells(1, 1) = x

               If x = 5 Then

                 Exit Sub

               End If

            Next x

              Range("b1") = 100

         End Sub

      b、Exit function语句

        Function ff()

           Dim x As Integer

           For x = 1 To 100

             If x = 5 Then

               Exit Function

             End If

           Next x

             ff = 100

         End Function

       c、Exit for语句

         Sub e2()

         Dim x As Integer

            For x = 1 To 100

              Cells(1, 1) = x

              If x = 5 Then

                Exit For

              End If

            Next x

              Range("b1") = 100

         End Sub

     d、Exit do 语句

        Sub e3()

         Dim x As Integer

          Do

            x = x 1

             Cells(1, 1) = x

             If x = 5 Then

               Exit Do

             End If

          Loop Until x = 100

           Range("b1") = 100

        End Sub

  C、VBA分支语句

     Option Explicit

     a、Goto语句,跳转到钦赐的地点

        Sub t1()

        Dim x As Integer

        Dim sr

        100:

        sr = Application.InputBox("请输入数字", "输入提示")

        If Len(sr) = 0 Or Len(sr) = 5 Then GoTo 100

        End Sub

    注:“100:”正是四个Goto语句能够跳入的注解。“Len(sr)=0”表示输入框未有输入,“Len(sr) = 5”表裁撤。其实质便是“false”是5个字符。

        澳门新萄京官方网站 27

b、gosub..return ,跳过去,再跳回来

   Sub t2()

      Dim x As Integer

      For x = 1 To 10

       If Cells(x, 1) Mod 2 = 0 Then GoSub 100

      Next x

   Exit Sub

    100:

     Cells(x, 1) = "偶数"

    Return    '跳到gosub 100 这一句

  End Sub

c、on error resume next '遭逢错误,跳过继续实施下一句

  Sub t3()

   On Error Resume Next

   Dim x As Integer

     For x = 1 To 10

       Cells(x, 3) = Cells(x, 2) * Cells(x, 1)

     Next x

   End Sub

d、on error goto  '出错开上下班时间跳到钦点的行数

   Sub t4()

    On Error GoTo 100

    Dim x As Integer

    For x = 1 To 10

       Cells(x, 3) = Cells(x, 2) * Cells(x, 1)

    Next x

      Exit Sub

    100:

      MsgBox "在第" & x & "行出错了"

    End Sub

 e、on error goto 0 '打消错误跳转

   Sub t5()

      On Error Resume Next

      Dim x As Integer

      For x = 1 To 10

      If x > 5 Then On Error GoTo 0

         Cells(x, 3) = Cells(x, 2) * Cells(x, 1)

      Next x

         Exit Sub

   End Sub

 

 

17、Excel文件操作的多少个概念

    A、excel文件和职业簿概念

      excel文件正是excel专门的学问簿,excel文件张开须求excel程的支撑

      Workbooks  专业簿集合,泛指excel文件或职业簿

      Workbooks("A.xls"),名称为A的excel工作簿

     Sub t1()

        Workbooks("A.xls").Sheets(1).Range("a1") = 100

     End Sub

                                                           

     workbooks(2),按张开各类,第4个展开的工作簿。

      Sub t2()

        Workbooks(2).Sheets(2).Range("a1") = 200

     End Sub

                                                           

     ActiveWorkbook ,当展开八个excel职业簿时,你正在操作的不行正是ActiveWorkbook(活动工作簿)

     Thisworkbook,VBA程序所在的专业簿,无论你张开多少个专门的学业簿,无论当前是哪些专门的职业簿是活动的,thisworkbook就是指它所在的工作簿。

 

   B、专门的学业簿窗口

       Windows("A.xls"),A职业簿的窗口,使用windows能够安装工作簿窗口的动静,如是或不是隐身等。

       Sub t3()

          Windows("A.xls").Visible = False

       End Sub

                                                                                          

       Sub t4()

        Windows(2).Visible = True

       End Sub

                                                                                          

18、Excel文件的操作

   A、 判别A.Xls文件是或不是留存

     Sub W1()

     If Len(Dir("d:/A.xls")) = 0 Then

       MsgBox "A文件子虚乌有"

     Else

       Msg博克斯 "A文件存在"

     End If

    End Sub

  B、 推断A.Xls文件是或不是展开

    Sub W2()

     Dim X As Integer

      For X = 1 To Windows.Count

        If Windows(X).Caption = "A.XLS" Then

          MsgBox "A文件张开了"

          Exit Sub

        End If

      Next

    End Sub

C、excel文件新建和保留

   Sub W3()

     Dim wb As Workbook

     Set wb = Workbooks.Add

       wb.Sheets("sheet1").Range("a1") = "abcd"

     wb.SaveAs "D:/B.xls"

  End Sub

D、 excel文件展开和关闭  

  Sub w4()

    Dim wb As Workbook

    Set wb = Workbooks.Open("D:/B.xls")

    MsgBox wb.Sheets("sheet1").Range("a1").Value

    wb.Close False

  End Sub

E、 excel文件保留和备份

   Sub w5()

      Dim wb As Workbook

      Set wb = ThisWorkbook

      wb.Save

      wb.SaveCopyAs "D:/ABC.xls"

    End Sub

 F、 excel文件复制和删除

    Sub W6()

      FileCopy "D:/ABC.XLS", "E:/ABCd.XLS"

      Kill "D:/ABC.XLS"

End Sub

19、工作表的概念

   A、excel工作表的归类

      excel工作表有两大类,一类是我们平常用的专门的学问表(worksheet),另一类是图表、宏表等。这两类的统称是sheets

      sheets  专门的学业表会集,泛指excel种种职业表

      Sheets("A"),名称为A的excel工作表

                                                                              

      Sub t1()

        Sheets("A").Range("a1") = 100

      End Sub

                                                                              

     ' workbooks(2),按展开各类,第四个张开的专门的工作簿。

        Sub t2()

          Sheets(2).Range("a1") = 200

       End Sub

     'ActiveSheet ,当展开八个excel专门的学问簿时,你正在操作的不行就是ActiveSheet

                                                                                

  20、工作表的操作

     A、判定A职业表文件是不是存在

       Sub s1()

        Dim X As Integer

         For X = 1 To Sheets.Count

           If Sheets(X).Name = "A" Then

             MsgBox "A工作表存在"

             Exit Sub

           End If

         Next

         MsgBox "A专业表不设有"

       End Sub  

     B、 excel职业表的插入

        Sub s2()

          Dim sh As Worksheet

          Set sh = Sheets.Add

           sh.Name = "模板"

          sh.Range("a1") = 100

        End Sub

     C、 excel职业表遮盖和打消掩盖

        Sub s3()

         Sheets(2).Visible = True

        End Sub

     D、 excel专门的学业表的移位

        Sub s4()

         Sheets("Sheet2").Move before:=Sheets("sheet1") 'sheet2移动到sheet1前面

         Sheets("Sheet1").Move after:=Sheets(Sheets.Count) 'sheet1运动到持有工作表的终极面

        End Sub

    E、 excel工作表的复制

       Sub s5() '在本专门的学问簿中

          Dim sh As Worksheet

           Sheets("模板").Copy before:=Sheets(1)

           Set sh = ActiveSheet

              sh.Name = "1日"

             sh.Range("a1") = "测试"

        End Sub

    F、工作表的保留

       Sub s6() '另存为新专门的工作簿

           Dim wb As Workbook

            Sheets("模板").Copy

            Set wb = ActiveWorkbook

               wb.SaveAs ThisWorkbook.Path & "/1日.xls"

               wb.Sheets(1).Range("b1") = "测试"

               wb.Close True

       End Sub

   G、 爱抚专门的学问表

        Sub s7()

           Sheets("sheet2").Protect "123"

        End Sub

        Sub s8() '决断工作表是不是增多了保养密码

           If Sheets("sheet2").ProtectContents = True Then

             MsgBox "专业簿保护了"

           Else

             MsgBox "专业簿未有添加入保证护"

           End If

        End Sub

   H、专门的职业表删除

       Sub s9()

           Application.DisplayAlerts = False

              Sheets("模板").Delete

           Application.DisplayAlerts = True

       End Sub

  I、专门的学业表的挑选

       Sub s10()

            Sheets("sheet2").Select

        End Sub

 

本文由澳门新萄京官方网站发布于办公软件,转载请注明出处:澳门新萄京官方网站:韵脚代码,EXCEL怎么着自动

关键词: