Column of ascii from text input

nicksoph

Board Regular
Joined
Jun 13, 2009
Messages
57
Hi,

Im trying to create a column of numbers that are generated from text input.

The text input could be several thousand characters long and I would like to generate a column in excel of their ascii codes with each cell showing the ascii code for one of the characters.

Any help with a good place to start would be appreciated.

Best wishes
nick
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hi

In what format are you receiving the input text? Is it a text file? (like csv or txt format). Or are you inputting the text into Excel?

Andrew
 
Upvote 0
For:

Excel Workbook
ABC
1Im trying to create a column of numbers that are generated from text input. The text input could be several thousand characters long and I would like to generate a column in excel of their ascii codes with each cell showing the ascii code for one of the characters.Any help with a good place to start would be appreciated.Best wishesnick
273
3109
432
5116
6114
Sheet1



(NOTE: Rows cut-off for post)

Try:

<font face=Courier New><SPAN style="color:#00007F">Option</SPAN> <SPAN style="color:#00007F">Explicit</SPAN><br>    <br><SPAN style="color:#00007F">Sub</SPAN> exa()<br><SPAN style="color:#00007F">Dim</SPAN> lChar&, Ary<br>    <br>    <SPAN style="color:#00007F">If</SPAN> Len(Range("A1").Value) >= 1 <SPAN style="color:#00007F">Then</SPAN><br>        <SPAN style="color:#00007F">ReDim</SPAN> Ary(1 <SPAN style="color:#00007F">To</SPAN> Len(Range("A1").Value), 1 <SPAN style="color:#00007F">To</SPAN> 1)<br>        <SPAN style="color:#00007F">For</SPAN> lChar = 1 <SPAN style="color:#00007F">To</SPAN> <SPAN style="color:#00007F">UBound</SPAN>(Ary, 1)<br>            Ary(lChar, 1) = Asc(Mid(Range("A1").Value, lChar, 1))<br>        <SPAN style="color:#00007F">Next</SPAN><br>        <br>        Range("B2").Resize(UBound(Ary, 1)).Value = Ary<br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br></FONT>

Hope that helps,

Mark
 
Upvote 0
If the long string is entered in cell A1, put in cell B1:

=CODE(MID($A$1,ROW(),1))

Copy the formula down as far as needed.

Wigi
 
Upvote 0
Fantastic

both the answers and the speed of replies

I shall be nicer to some other peps because I cant be nice to either of you.

many thanks
nick
 
Upvote 0

Forum statistics

Threads
1,224,974
Messages
6,182,094
Members
453,088
Latest member
Chaoxite

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top