wildswing Posted May 9, 2009 Report Posted May 9, 2009 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!
Joe E. Posted May 9, 2009 Report Posted May 9, 2009 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
wildswing Posted May 11, 2009 Author Report Posted May 11, 2009 (edited) 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 May 11, 2009 by wildswing
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now