getpy函数用不了怎么办

时间:2024-10-12 06:46:07

1、Excel开发工具处,打开VB界面(快捷键Alt+F11)

getpy函数用不了怎么办

2、单击图片中所示的左上角空白处,选择【插入】—【模块】

getpy函数用不了怎么办

3、输入以下代码Function pinyin(p As String) A衡痕贤伎s Stringi = Asc(p)Select Case iC锾攒揉敫ase -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

getpy函数用不了怎么办

4、输入getpy函数

getpy函数用不了怎么办

5、验证成功

getpy函数用不了怎么办

6、【总结】1、保存函数代码2、运用VBA自定义函数3、调用函数并验证

© 手抄报圈