Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting a hex value contained in a string to integer 1

Status
Not open for further replies.

adi316

Programmer
Sep 10, 2002
35
0
0
CA
Hi. I have a string which contains a hex value. I want to somehow convert this value to an int. how is it possible? TIA
 
You can use the Val function:

Dim l As Long
Dim sHex As String

sHex = "A0"
l = CLng("&H" & sHex)

The leading "&H" tells Val that your value is in hexadecimal.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top