Sign in to follow this  
Followers 0
wildswing

Need help converting ASCII to Decimal

4 posts in this topic

Does anyone know of a VB code or function that I could use in MS Excel to convert ASCII text into it's decimal equivalent? I'm not VB savy at all. I need something that will do this... A ---> 65 B ---> 66 C ---> 67 What I'm eventually trying to achieve is a spreadsheet in which I enter ASCII text string and have it return the equivalent decimal values like this... Text entered (one character per cell - 20 characters max)... 3/8 X 8 SUP Returned decimal equivalents would be... 51 47 56 32 88 32 56 32 83 85 80 I can take it from there. Those will be converted to binary and combined into 16 bit integers for use in selecting recipes in an oem apps database. Your help would be very much appreciated. Thanks in advance!

Share this post


Link to post
Share on other sites
If you wish to do the conversion in a cell formula, the Code() function should do it. In a macro, use Asc(). a quick and dirty: in cell A2, enter: =CODE(A1) with "3" in A1, A2 displays "51" In a macro: Range("A3") = Asc(Range("A1")) This is demonstrated, roughly, in the attached Excel file Char_to_ASCII.xls

Share this post


Link to post
Share on other sites
Thanks Joe, Here's what I did. I entered the text string in cell A1. Across row 2, I copied the following function: =CODE(MID($A1,COLUMN(),1)) Edited by wildswing

Share this post


Link to post
Share on other sites
Cool! glad to help

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0