Is there a function that will convert from Hex to Decimal? I see a HEX(decimal#) function which will take a decimal number and convert to Hex, but can't seem to find a function that will do the reverse.
Option Explicit
Private Sub Command1_Click()
MsgBox Hex2Dec(Text1.Text)
End Sub
Private Function Hex2Dec(ByVal sHex As String) As Long
On Error Resume Next
Hex2Dec = Val("&H" & sHex)
End Function
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.