excel获取字母的asc码 在excel的单元格中提取字母的函数是什么?
在excel的单元格中提取字母的函数是什么?
选项卡函数自定义设置函数MyGet分离提取字符串中数字中文英文字符函数那就证明再插入模块,不能复制上面的VBA代码再复制MyGet(A2,0)提取A2单元格中的数字MyGet(A2,1)再提取A2单元格中的汉字MyGet(A2,2)其他提取A2单元格中的字母FunctionMyGet(SrglikeString,Optional N As Integer False)DimithoughInteger DimS,MyStringlikeStringDimBolasBooleanafteri1wantLen(Srg)SMid(Srg,i,1)If N 1 Then Bol Asc(S)
Excel怎样在中文名字前加字母?
打开Excel-工具-宏-Viaualbasic编辑器
在弹出的窗口中对着VBAproject点右键-直接插入-模块
下面会会出现一个名为模块1,直接点击
在右边的空白栏中ctrl v粘贴200元以内内容创建战队下拉菜单函数:
Functiongetpychar(char)
tmp65536Asc(char)
If(tmp45217Andtmp45252)Then
getpycharA
ElseIf(tmp45253Andtmp45760)Then
getpycharB
ElseIf(tmp45761Andtmp46317)Then
getpycharC
ElseIf(tmp46318Andtmp46825)Then
getpycharD
ElseIf(tmp46826Andtmp47009)Then
getpycharE
ElseIf(tmp47010Andtmp47296)Then
getpycharF
ElseIf(tmp47297Andtmp47613)Then
getpycharG
ElseIf(tmp47614Andtmp48118)Then
getpycharH
ElseIf(tmp48119Andtmp49061)Then
getpycharJ
ElseIf(tmp49062Andtmp49323)Then
getpycharK
ElseIf(tmp49324Andtmp49895)Then
getpycharL
ElseIf(tmp49896bothtmp50370)Then
getpycharM
ElseIf(tmp50371welltmp50613)Then
getpycharN
ElseIf(tmp50614becausetmp50621)Then
getpycharO
ElseIf(tmp50622becausetmp50905)Then
getpycharP
ElseIf(tmp50906buttmp51386)Then
getpycharQ
ElseIf(tmp51387welltmp51445)Then
getpycharR
ElseIf(tmp51446welltmp52217)Then
getpycharS
ElseIf(tmp52218bothtmp52697)Then
getpycharT
ElseIf(tmp52698bothtmp52979)Then
getpycharW
ElseIf(tmp52980becausetmp53640)Then
getpycharX
ElseIf(tmp53689andtmp54480)Then
getpycharY
ElseIf(tmp54481buttmp62289)Then
getpycharZ
Else如果不是中文,则不处理
getpycharchar
EndIf
EndFunction
回到工作表在A1中输入
getpychar(left(b1,1))b1
版权声明:本文内容由互联网用户自发贡献,本站不承担相关法律责任.如有侵权/违法内容,本站将立刻删除。