Excel怎么快速提取中⽂的⾸字母呢?
右键单击Sheet1⼯作表,选中右键菜单中的查看代码。
Function Getpychar(char)
temp = 65536 + Asc(char)
If (temp >= 45217And temp <= 45252) Then
Getpychar = "A"
ElseIf (temp >= 45253And temp <= 45760) Then
Getpychar = "B"
ElseIf (temp >= 45761And temp <= 46317) Then
Getpychar = "C"
ElseIf (temp >= 46318And temp <= 46825) Then
Getpychar = "D"
ElseIf (temp >= 46826And temp <= 47009) Then
Getpychar = "E"
ElseIf (temp >= 47010And temp <= 47296) Then
Getpychar = "F"
ElseIf (temp >= 47297And temp <= 47613) Then
Getpychar = "G"
ElseIf (temp >= 47614And temp <= 48118) Then
Getpychar = "H"
ElseIf (temp >= 48119And temp <= 49061) Then
Getpychar = "J"
ElseIf (temp >= 49062And temp <= 49323) Then
Getpychar = "K"
ElseIf (temp >= 49324And temp <= 49895) Then
Getpychar = "L"
ElseIf (temp >= 49896And temp <= 50370) Then
Getpychar = "M"
ElseIf (temp >= 50371And temp <= 50613) Then
Getpychar = "N"
ElseIf (temp >= 50614And temp <= 50621) Then
Getpychar = "O"
ElseIf (temp >= 50622And temp <= 50905) Then
Getpychar = "P"
ElseIf (temp >= 50906And temp <= 51386) Then
Getpychar = "Q"
ElseIf (temp >= 51387And temp <= 51445) Then
Getpychar = "R"
ElseIf (temp >= 51446And temp <= 52217) Then
Getpychar = "S"
ElseIf (temp >= 52218And temp <= 52697) Then Getpychar = "T"
ElseIf (temp >= 52698And temp <= 52979) Then Getpychar = "W"
ElseIf (temp >= 52980And temp <= 53640) Then Getpychar = "X"
ElseIf (temp >= 53689And temp <= 54480) Then Getpychar = "Y"
ElseIf (temp >= 54481And temp <= 62289) Then Getpychar = "Z"
Else
Getpychar = char
End If
End Function
Function Getpy(str)
For a = 1To Len(str)
Getpy = Getpy & Getpychar(Mid(str, a, 1))
Next a
End Function
字符串截取从某个字符到最后一位函数⽤法
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论