Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    128

    Unanswered: String conversion

    HI all,
    I'm getting to strings. The strings have Hex number e.g("FF54").
    My target is to do mathimatical operation with the two strings
    as along number.
    How can I do that? which command convert from hex string to long number
    best regads...

  2. #2
    Join Date
    Aug 2004
    Location
    Abu-Dhabi, U.A.E
    Posts
    5
    This function will convert a hex to decimal.
    Code:
    Function HexToDec(HexValue As String, Optional ToInteger As Boolean) As Long
        If ToInteger Then
            ' convert to an integer value, if possible.
            ' Use CInt() if you want to *always* convert to an Integer
            HexToDec = Val("&H" & HexValue)
        Else
            ' always convert to a Long. You can also use the CLng() function.
            HexToDec = Val("&H" & HexValue & "&")
        End If
    End Function
    HTH

Posting Permissions

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