Thread: text to column
View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.misc
ChewinFoil ChewinFoil is offline
external usenet poster
 
Posts: 6
Default text to column

So now that I understand the MID function is there any way to use the
individually displayed characters as numbers. Since the function is just
displaying the character in that position is there any way to use the actual
value? For example from my original question could the 5 4 4 5 6 5 5 now be
added to equal 34. Thanks.

--
ChewinFoil --)--------


"Chip Pearson" wrote:

You can do it with code:

Sub AAA()
Dim InputText As String
Dim Dest As Range
Dim N As Long

' InputText is the text to be split.
' Change to the appropriate cell.
InputText = Range("A1").Text
' OR
'InputText = ActiveCell.Text

' Dest is the location to write the
' digits of InputText. Change as needed.
Set Dest = Range("B1") ' start output cell
' OR
'Set Dest = ActiveCell(1, 2)
For N = 1 To Len(InputText)
Dest(1, N).Value = Mid(InputText, N, 1)
Next N
End Sub

Or, you can use a formula. If the data to be split is in cell A1, and
the individual digit cells begin in F3, use

=MID($A$1,COLUMN()-COLUMN($F$3)+1,1)

Then, copy this formula to the right for (at least) as many columns as
there are characters in A1.

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Mon, 8 Dec 2008 10:10:12 -0800, ChewinFoil
wrote:

I am copying data from a web app into excel. As series of numbers copies in
as one field. Example: 5 4 4 5 6 5 5 as 5445655. I know how to use text to
column and a width as delimiter to break this back up into individual numbers
but I don't want to have to run the wizard every time. Is there any way to
make a number pasted into a cell automatically break down into it's component
digits?

Thanks,