Home All Groups Group Topic Archive Search About

Converting Hex to Float?

Author
8 Jun 2009 11:42 AM
Raj
How to convert Hex values into Float?

Thank you

Regards

Raj

Author
8 Jun 2009 12:13 PM
Nobody
"Raj" <R**@discussions.microsoft.com> wrote in message
news:2A389C63-D231-4205-9EEF-EC078921BAA1@microsoft.com...
> How to convert Hex values into Float?

See "Let statement", and CopyMemory. If the hex values are in string format,
try:

Debug.Print Val("&H" & "12")

Here is a close example to what you want using  Let:

How To Do 64-bit Arithmetic in VBA
http://support.microsoft.com/kb/189862

Float is Single in VB, 32 bits.
Author
8 Jun 2009 12:14 PM
Nobody
Typo, it's LSet, not Let.
Author
8 Jun 2009 12:44 PM
Jim Mack
Raj wrote:
> How to convert Hex values into Float?

Your question is too broad to answer without more information.

Where do the hex values come from and in what form?

Do you have some examples of your hex values and their float
equivalents?

--
   Jim Mack
   Twisted tees at http://www.cafepress.com/2050inc
   "We sew confusion"
Author
8 Jun 2009 1:39 PM
Jeff Johnson
"Raj" <R**@discussions.microsoft.com> wrote in message
news:2A389C63-D231-4205-9EEF-EC078921BAA1@microsoft.com...

> How to convert Hex values into Float?

    Dim d As Double

    d = Val("&H" & someHexString)

If you're looking for something more specific, ask a more specific question.