Hex => Decimal
Author Message
Hex => Decimal

Quote:
> how can I convert a Hexadecimal String (#80FF80#) to a Long Value?

Use Val(), like this:

sHex = "123ABC"
nHexValue = Val("&H" & sHex)

Debug.Print sHex; " = "; nHexValue

--

http://www.*-*-*.com/
Sample code and utilities.

Wed, 04 Sep 2002 03:00:00 GMT
Hex => Decimal
Don't use Val -- use CLng instead (Nikolai -- everything else is the same).
Try yours with sHex = "FFFF" and tell me that is the result you wanted. CLng
doesn't suffer from that conversion problem.

Rick

Quote:

> > how can I convert a Hexadecimal String (#80FF80#) to a Long Value?

> Use Val(), like this:

>     sHex = "123ABC"
>     nHexValue = Val("&H" & sHex)

>     Debug.Print sHex; " = "; nHexValue

> --

> http://www.scottandmichelle.net/scott/code/
> Sample code and utilities.

Wed, 04 Sep 2002 03:00:00 GMT
Hex => Decimal

Full source of a program i made that convert's hex to dec
dec to hex, and more... The program is called "Password-Creator"

Quote:
> Don't use Val -- use CLng instead (Nikolai -- everything else is the
same).
> Try yours with sHex = "FFFF" and tell me that is the result you wanted.
CLng
> doesn't suffer from that conversion problem.

> Rick

> > > how can I convert a Hexadecimal String (#80FF80#) to a Long Value?

> > Use Val(), like this:

> >     sHex = "123ABC"
> >     nHexValue = Val("&H" & sHex)

> >     Debug.Print sHex; " = "; nHexValue

> > --

> > http://www.scottandmichelle.net/scott/code/
> > Sample code and utilities.

Wed, 04 Sep 2002 03:00:00 GMT
Hex => Decimal
Hello,

how can I convert a Hexadecimal String (#80FF80#) to a Long Value?

Thu, 05 Sep 2002 03:00:00 GMT
Hex => Decimal
the Val() function returns a double, not a long

Mr. X

Quote:

> > how can I convert a Hexadecimal String (#80FF80#) to a Long Value?

> Use Val(), like this:

>     sHex = "123ABC"
>     nHexValue = Val("&H" & sHex)

>     Debug.Print sHex; " = "; nHexValue

> --

> http://www.scottandmichelle.net/scott/code/
> Sample code and utilities.

Thu, 05 Sep 2002 03:00:00 GMT
Hex => Decimal
I don't know an easy way to convert it, but you can assign it as
follows:

Dim Var As Long
Var = &H80FF80
debug.print Var
Text1.Text = format(Var)

Good Luck,
G.Doucet

Quote:

> Hello,

> how can I convert a Hexadecimal String (#80FF80#) to a Long Value?

Thu, 05 Sep 2002 03:00:00 GMT

 Page 1 of 1 [ 6 post ]

Relevant Pages