Excel表格下拉列表怎么设置呢?很多用户对此还不是很清楚,小编这里就给大家带来有关Excel表格下拉列表怎么设置的回答,希望能够对大家有所帮助。......
2023-01-18
步骤如下:
1.ALt+F11,打开VBE界面,左上角空白处,点击右键,插入模块
2.在模块的空白处,粘贴上如下代码:
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
3.关闭VBE界面,返回Excel,就可以像正常函数一样使用自定义的Getpy函数,来取得文本的拼音缩写了
相关文章
Excel表格下拉列表怎么设置呢?很多用户对此还不是很清楚,小编这里就给大家带来有关Excel表格下拉列表怎么设置的回答,希望能够对大家有所帮助。......
2023-01-18
Excel如何打印选定区域呢?很多用户对此还不是很清楚,小编这里就给大家带来有关Excel如何打印选定区域的回答,希望能够对大家有所帮助。......
2023-01-18
Excel怎么设置英文首字母大写?Excel中输入英文首字母大写怎么操作?当我们需要将Excel表格中的英文单词,把首字母全部大写,该怎么操作呢,怎么将Excel中英文首字母大写,Excel怎么设置英文首字母大写,下面就和小编一起来看看吧!......
2023-01-18
Excel怎么给所有的数字加10?Excel数字怎么全部加10?怎么全部加1?当我们在使用Excel时,所有的数字都少10,或者1,该怎么给所有的数字都+10、+1呢,Excel怎么给所有的数字加10,EXcel数字怎么全部加10,下面就和小编一起来看看吧!......
2023-01-18
Excel怎么设置日期自动更新?Excel怎么设置日期自动更新?当我们Excel表格中的日期需要实时更新到最新日期,该怎么设置呢,怎么将Excel表格日期自动更新到最新日期,Excel怎么设置日期自动更新,下面就和小编一起来看看吧!......
2023-01-18