excel中的汉字和GBK编码
2个回答
展开全部
可以,不过要用自定义函数,在B2输入公式如图
=GetGBK(A2)
自定义函数代 码 如 下
Function GetGBK(strInput As String) As String
Dim x() As Byte
Dim i As Integer
x = strInput
x = StrConv(x, vbFromUnicode)
If (UBound(x) - LBound(x) + 1) / Len(strInput) <> 2 Then
GetGBK = "你输入包含非中文字符"
Else
For i = 0 To UBound(x) Step 2
GetGBK = GetGBK & Hex(x(i)) & Hex(x(i + 1)) & " "
Next i
GetGBK = Trim(GetGBK)
End If
End Function
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询