excel表格中如何自动填写拼音首字母缩写
来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/13 20:46:45
excel表格中如何自动填写拼音首字母缩写
单位的软件要求把产品的助记码加上去,规则为产品的拼音首字母缩写
如:会议用吵人小喇叭变成:HYYCRXLB
急
单位的软件要求把产品的助记码加上去,规则为产品的拼音首字母缩写
如:会议用吵人小喇叭变成:HYYCRXLB
急
把下面的代码复制在一个VBE模块里面,然后在工作表里面像使用其他函数一样使用HZP()函数就可以了
比如A1 是 中国人 则在B1输入公式:=HZP(a1) 就会显示结果 ZGR
还不明白的话 HI我
Option Explicit
Public Function py(mystr As String) As String
Dim i As Long
i = Asc(mystr)
Select Case i
Case -20319 To -20284:py = "A"
Case -20283 To -19776:py = "B"
Case -19775 To -19219:py = "C"
Case -19218 To -18711:py = "D"
Case -18710 To -18527:py = "E"
Case -18526 To -18240:py = "F"
Case -18239 To -17923:py = "G"
Case -17922 To -17418:py = "H"
Case -17417 To -16475:py = "J"
Case -16474 To -16213:py = "K"
Case -16212 To -15641:py = "L"
Case -15640 To -15166:py = "M"
Case -15165 To -14923:py = "N"
Case -14922 To -14915:py = "O"
Case -14914 To -14631:py = "P"
Case -14630 To -14150:py = "Q"
Case -14149 To -14091:py = "R"
Case -14090 To -13319:py = "S"
Case -13318 To -12839:py = "T"
Case -12838 To -12557:py = "W"
Case -12556 To -11848:py = "X"
Case -11847 To -11056:py = "Y"
Case -11055 To -10247:py = "Z"
Case Else:py = mystr
End Select
End Function
Function HZP(strn As String)
Dim i As Integer
For i = 1 To Len(strn)
HZP = HZP & py(Mid(strn,i,1))
Next i
End Function
比如A1 是 中国人 则在B1输入公式:=HZP(a1) 就会显示结果 ZGR
还不明白的话 HI我
Option Explicit
Public Function py(mystr As String) As String
Dim i As Long
i = Asc(mystr)
Select Case i
Case -20319 To -20284:py = "A"
Case -20283 To -19776:py = "B"
Case -19775 To -19219:py = "C"
Case -19218 To -18711:py = "D"
Case -18710 To -18527:py = "E"
Case -18526 To -18240:py = "F"
Case -18239 To -17923:py = "G"
Case -17922 To -17418:py = "H"
Case -17417 To -16475:py = "J"
Case -16474 To -16213:py = "K"
Case -16212 To -15641:py = "L"
Case -15640 To -15166:py = "M"
Case -15165 To -14923:py = "N"
Case -14922 To -14915:py = "O"
Case -14914 To -14631:py = "P"
Case -14630 To -14150:py = "Q"
Case -14149 To -14091:py = "R"
Case -14090 To -13319:py = "S"
Case -13318 To -12839:py = "T"
Case -12838 To -12557:py = "W"
Case -12556 To -11848:py = "X"
Case -11847 To -11056:py = "Y"
Case -11055 To -10247:py = "Z"
Case Else:py = mystr
End Select
End Function
Function HZP(strn As String)
Dim i As Integer
For i = 1 To Len(strn)
HZP = HZP & py(Mid(strn,i,1))
Next i
End Function
excel表格中如何自动填写拼音首字母缩写
Excel表格如何自动计算并填写
怎样在Excel表格中自动填写百分比?
如何在excel中,填写一个条件后,在其他表格中自动出来相应的数据值.
如何把EXCEL中一个表格中含有顿号的内容分开,并且顿号后的内容自动依次填写到下一列表格中.
如何让excel表格中条件颜色数字自动相加
excel表格中在一个单元格中填写一个数字,另外一个单元格自动填写与之对应的数值
excel中如何自动添加表格,就是在单元格内添加数据后边框自动添加
如何excel表格数据自动四舍五入?
excel表格如何自动排abcd
EXCEL中表格公式自动更改问题
excel中如何实现提取汉字的拼音首字母?