Text to Columns

Jonstevens

New Member
Joined
Mar 20, 2009
Messages
3
Hi, I have a column of data that I want to turn into two columns. The dividing point is a random number. Each cell is different than the others so the number shows up in different spaces making fixed width not possible. How can I make the change? Thanks
Jon
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Re: Text to Collumns

Jane Smith CGM IRA Custodian 164 Main St
Jon Smith CGM IRA Rollover Custodian 543 Main St
Jane White CGM IRA Custodian 1567 Main St
Jon White 105 Main St
 
Upvote 0
Re: Text to Collumns

Paste this UDF into a standard module

Function Getnum(inpt As String)
Dim i As Integer
For i = 1 To Len(inpt)
If IsNumeric(Mid(inpt, i, 1)) Then
Getnum = i
Getnum = CLng(Getnum)
Exit Function
End If
Next i
Getnum = CLng(Getnum)
End Function

Then with your furnished data in A1:A4 enter into B1 and copy down:

=LEFT(A1,Getnum(A1)-2)

Enter into C1: =RIGHT(A1,LEN(A1)-LEN(B1)-1) and copy down
 
Upvote 0

Forum statistics

Threads
1,213,527
Messages
6,114,150
Members
448,552
Latest member
WORKINGWITHNOLEADER

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