wildswing
May 9 2009, 01:00 PM
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.
May 9 2009, 04:11 PM
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
wildswing
May 11 2009, 08:58 AM
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))
Joe E.
May 12 2009, 07:39 PM
QUOTE(wildswing @ May 11 2009, 09:58 AM) [snapback]82103[/snapback]
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))
Cool! glad to help
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.