+ Reply to Thread
Results 1 to 4 of 4

VBA - Hex To ASCII

  1. #1
    Forum Contributor
    Join Date
    12-22-2004
    Location
    Kokomo, Indiana
    Posts
    236

    Question VBA - Hex To ASCII

    Group,
    Is there a function in VBA that will convert hex into ascii. Example assume I have 0x39 and I want it to convert it to ascii, or 9. Same goes for the alpha characters as well A thru Z both lower case and upper case.

    Tony

  2. #2
    Registered User
    Join Date
    05-14-2006
    Posts
    33
    Excel provides the Char(value) function, where value is the decimal representation of the ASCII character. The function returns the ASCII character represented by the number.

    Note that before using this function, your code will have to convert the hexadecimal value to decimal first.

  3. #3
    AA2e72E
    Guest

    RE: VBA - Hex To ASCII

    Try:

    Chr(Clng("&H" &yourHEXstring))



  4. #4
    Tom Ogilvy
    Guest

    RE: VBA - Hex To ASCII

    ? chr(&H39)
    9

    --
    Regards,
    Tom Ogilvy


    "ajocius" wrote:

    >
    > Group,
    > Is there a function in VBA that will convert hex into ascii.
    > Example assume I have 0x39 and I want it to convert it to ascii, or 9.
    > Same goes for the alpha characters as well A thru Z both lower case and
    > upper case.
    >
    > Tony
    >
    >
    > --
    > ajocius
    > ------------------------------------------------------------------------
    > ajocius's Profile: http://www.excelforum.com/member.php...o&userid=17695
    > View this thread: http://www.excelforum.com/showthread...hreadid=544141
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1