Closed Thread
Results 1 to 6 of 6

Convert ASCII Character strings into HEX Strings

  1. #1
    Registered User
    Join Date
    03-04-2008
    Location
    Brisbane, Australia
    Posts
    3

    Convert ASCII Character strings into HEX Strings

    In an Excel worksheet, I would like to enter a persons Name, complete with Initial Caps and Spaces into cell A2 and have it converted into a HEX string in B2.

    The formula would be replicated down the page so that lists of names and their HEX equivalents could be created.

    The purpose of this is for inputting the HEX Strings into the Speed-Dial library in a Phone System.

    Any help will be greatly appreciated. I have hundreds of names to input!

    Example: A B
    2 Chris Mathers 4368726973204D617468657273

    Sincerely, Chris Mathers

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,604
    Here's a small user function:
    Please Login or Register  to view this content.
    copy the code, then
    In XL, select Tools -> Macros -> VB Editor
    in the project explorer pane, right click the vbproject withe the name of your workbook, select Insert...module
    paste into the new module and close the VB Editor.

    In cell B2, or where ever you want the hexcodes, type
    =asc2hex(A2), then copy down the column.
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    03-04-2008
    Location
    Brisbane, Australia
    Posts
    3

    Smile Convert ASCII Charaacter strings into HEX Strings



    Dear Ben...

    What a fan you have 'Down Under'!

    Your code worked a treat, thank you! This is the first time I have used a forum so you can imagine my pleasure. All sorted in under 24 hours. Thanks, again.

    Chris Mathers

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,604
    You're welcome.

  5. #5
    Registered User
    Join Date
    11-13-2010
    Location
    florida, USA
    MS-Off Ver
    Excel 2007 2010
    Posts
    1

    Re: Convert ASCII Character strings into HEX Strings

    I am totally unfamiliar with Excel in any form. I assume your instructions were for Excel 2003. Is there a similar function in Excel 2007 and/or Excel 2010?

    If so could you please tell me how to find it?

    I could use the same function you gave here although what I really need is a bit more complex and may not even be possible. It involves converting the data (alpha) in cell A to its
    "CRC32 HASH" value which would appear in Cell B and the "ADLER32 HASH" value which would appear in Cell C.

    Currently I am having to use 2 programs to do this along with cut and paste which is very tedious and prone to human error <mine >. I could probably come up with a way to use the hexadecimal conversion your provided but the ideal solution would be the hash values as that is what we have been using.

    Thanks for any help

  6. #6
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: Convert ASCII Character strings into HEX Strings

    You should start a new thread with the question you want answering, but in the meantime

    http://www.excelforum.com/excel-prog...ml#post2406840

    Might help!
    Regards
    Darren

    Update 12-Nov-2010 Still job hunting!

    If you are happy with the results, please add to our reputation by clicking the blue scales icon in the blue bar of the post.

    Learn something new each day, Embrace change do not fear it, evolve and do not become extinct!


Closed 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