新建From1(窗体),新建Command1(按钮CommandButton),代码:
Private Sub Command1_Click()
Dim f
Dim L1, R1 As Integer
Dim InputStr As String
InputStr = "码"
f = Hex(Asc(InputStr))
L1 = CInt("&H" + Mid(f, 1, 2))
R1 = CInt("&H" + Mid(f, 3, 2))
Debug.Print L1 & " " & R1
End Sub
运行结果:
194 235