Excel 怎么写自定义函数,能把汉字转换成Unicode代码? 50
展开全部
Function ChW(t)
If InStr(t, "\") Then
s = Split(t, "\")
For i = 0 To UBound(s)
If Left(UCase(s(i)), 1) = "U" Then
ChW = ChW & ChrW("&H" & Mid(s(i), 2))
Else
ChW = ChW & s(i)
End If
Next
Else
For i = 1 To Len(t)
s = AscW(Mid(t, i, 1))
If s > 0 And s < 255 Then
ChW = ChW & Mid(t, i, 1)
Else
ChW = ChW & "{""" & t & """,""" & Hex(s) & """}," '{"阿","963F"},
End If
Next
End If
End Function
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |