This is the source I use to convert a hex stored as a string to a decimal long. How it's done: I iterate through the HexNumber from left to right each place has a value of 16^(total length minus current position in strength) I multiply this value times the actual value of the place 0-15. Add up the values and return the sum.

Lonnie Brooke

Public Function HexToDecimal(HexNumber As String) As Long

Dim tmpAr() As Byte

Dim i&, j&, k&, t&, r&

Dim l$, m$

i = Len(HexNumber)

ReDim tmpAr(i) As Byte

j = 1

k = i - 1

While j < i + 1

t = Asc(Mid(HexNumber, j, 1))

Select Case t

Case 65 To 70

t = t - 55

Case 48 To 57

t = t - 48

End Select

r = r + ((16 ^ k) * t)

k = k - 1

j = j + 1

Wend

HexToDecimal = r

End Function

Lonnie Brooke

Public Function HexToDecimal(HexNumber As String) As Long

Dim tmpAr() As Byte

Dim i&, j&, k&, t&, r&

Dim l$, m$

i = Len(HexNumber)

ReDim tmpAr(i) As Byte

j = 1

k = i - 1

While j < i + 1

t = Asc(Mid(HexNumber, j, 1))

Select Case t

Case 65 To 70

t = t - 55

Case 48 To 57

t = t - 48

End Select

r = r + ((16 ^ k) * t)

k = k - 1

j = j + 1

Wend

HexToDecimal = r

End Function