作为helper,还是给一段代码,我的看法是,只要理解了二进制和十进制怎么转换,随手写个算法出来是很简单的事情,VB里具体实现就是结合几个函数。
Private Sub Form_Load()
Dim strInput As String, Result As Long
Result = 0
strInput = "5A"
Dim i As Long
Const strHex = "0123456789ABCDEF"
For i = 1 To Len(strInput)
Result = Result * 16 + InStr(strHex, Mid(strInput, i, 1)) - 1
Next
MsgBox Result
End Sub