发布网友 发布时间:2022-04-20 11:05
共3个回答
懂视网 时间:2022-05-10 01:40
excel的getpy函数用不了可能是因为getpy函数没有添加成功,添加方法如下:
1、进入VBA编写代码窗口
按Alt+F11打开VBA编写代码窗口。
2、插入模块
点击页面里的“插入”,在下拉菜单里点击“模块”。
3、输入代码
进入页面后编写getpy函数代码:Function pinyin(p As String) As Stringi = Asc(p)Select Case iCase -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 = pEnd SelectEnd FunctionFunction getpy(str)For i = 1 To Len(str)getpy = getpy & pinyin(Mid(str, i, 1))Next iEnd Function
4、返回Excel
关闭这个界面,在Excel里就可以使用Getpy函数了。
以上就是为大家介绍了excel的getpy函数用不了,希望对大家有所帮助。
热心网友 时间:2022-05-09 22:48
WPS表格中GET开头的函数只有一个为:GETPIVOTDATA提取存储在数据透视表的数据函数,而getpy应该是一个自定义函数,如果该当前电脑中没有自定义函数文件且已打开,是用不了的。热心网友 时间:2022-05-10 00:06
付费内容限时免费查看回答你好,很高兴为您解答。选择插入模块
打开Excel,同时按下Alt+F11键,打开VBE界面,单击图片中所示的左上角空白处,选择“插入“,”模块“;
插入了一个模块,后面的代码就要放到这个模块中,保证右侧空白区域是模块代码的编辑区,执行下一步;
复制代码
将下面的代码全部复制粘贴到空白区域,Function pinyin(p As String) As Stringi = Asc(p)Select Case iCase -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 -11
返回Excel
关闭这个新界面,返回Excel,就可以像Excel自带的函数一样使用这个自定义的Getpy函数了,它只有一个参数,参数可以直接指定单元格,也可以直接输入字符。