View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default How do I take a string of text and convert it ASCII Values?

On Mon, 11 Dec 2006 10:52:02 -0800, KBos@Minuteman
wrote:

I have a column containing a string of text of a fixed width, and I need to
make another column out that displays the ASCII values. How can I do this?
The Code function only allows me to display the ASCII value of the first
character in the column and I need the whole thing.


You don't describe exactly how you want the result displayed.

Here's one way that displays the ASCII values of the string with each value
separated by a <space.

Download and install Longre's free morefunc.xll addin from
http://xcell05.free.fr


Then use this formula, with your string in A1:

=REGEX.SUBSTITUTE(A1,"(.)","=CODE(""[1]"")&"" """)

As written, the formula will leave a trailing <space. If that is not OK, then
you could TRIM. If you want another separator, you'll need to eliminate the
separator(s) following the final character.


--ron