Results 1 to 3 of 3

Thread: Hexadecimal

  1. #1

    Thread Starter
    Hyperactive Member mastermind94's Avatar
    Join Date
    Jun 2000
    Location
    Montréal, Canada
    Posts
    441

    Arrow

    I know how to convert intergers to Hexa but, how do I convert hexa to integers?

    Thanx in advance

  2. #2
    Guest
    Code:
    'add into a module
    
    Public Function IntHex (HexValue As String) As Integer
        IntHex = Val("&H" & HexValue)
    End Function
    Hope I remembered this right,

  3. #3
    Lively Member
    Join Date
    Aug 2000
    Location
    Australia
    Posts
    82

    HexToInt

    Actually, I think you would be better off using CLng and converting Hex to Long Integer, as follows:

    If you use the Function previously posted, Val("&HFFFF&") results in -1.

    CLng("&HFFFF&") results in 65535.

    Val("&HFF00&") results in -256

    CLng("&HFF00&") results in 65280

    Cheers

    Adrian

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width