Hi all,
I need to split text in one cell to multiple cells. the text contains numbers as well & in fact the starting character within the cell is a number.
see attached file & kindly provide solution
Thanks
Hi all,
I need to split text in one cell to multiple cells. the text contains numbers as well & in fact the starting character within the cell is a number.
see attached file & kindly provide solution
Thanks
Last edited by MaheshK5277; 02-23-2016 at 07:15 AM.
Could you supply more rows of sample?
Quang PT
Hi Bebo,
rows added. see file attached
or just simly use "Text to column" for ur given example
Text to column-----------fixed width
If answer helped you say Thanks by Add Reputation
Ali
Enthusiastic self-taught user of MS Excel who's always learning!
Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.
NB: as a Moderator, I never accept friendship requests.
Forum Rules (updated August 2023): please read them here.
Ok Let try
C6=LEFT(A6,FIND(" ",A6)-1)
D6=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A6,E6,""),F6,""),G6,""),H6,""),C6,""))
E6=IFERROR(TRIM(RIGHT(SUBSTITUTE(TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A6,F6," "),G6," "),H6," "))," ",REPT(" ",50)),50)),0)
F6=IFERROR(-LEFT(SUBSTITUTE(TRIM(RIGHT(SUBSTITUTE(A6,"-",REPT(" ",50)),50))," ",REPT(" ",50)),50),0)
G6=IFERROR(TRIM(LEFT(SUBSTITUTE(TRIM(RIGHT(SUBSTITUTE(SUBSTITUTE(A6,"-",REPT(" ",50)),ABS(F6),REPT(" ",50)),50))," ",REPT(" ",50)),50)),0)
H6=IFERROR(TRIM(RIGHT(SUBSTITUTE(TRIM(RIGHT(SUBSTITUTE(SUBSTITUTE(A6,"-",REPT(" ",50)),ABS(F6),REPT(" ",50)),50))," ",REPT(" ",50)),50)),0)
and drag down
If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Hi Ankur,
Yes it works...many thanks bro...!!!![]()
Maybe with a code ?
Kind regards![]()
Sub test() Dim lasstrow As Long, mystring As String, r As Integer, x As Integer, j As Integer, i As Integer Dim col1 As String, col2 As String, col3 As String, col4 As String, col5 As String, col6 As String lastrow = Range("A" & Rows.Count).End(xlUp).Row For i = 6 To lastrow mystring = Replace(Range("A" & i), ".", "") r = Len(mystring) - Len(Replace(mystring, " ", "")) ReDim mypos(r) j = 1 For x = 1 To r mypos(x) = Application.Search(" ", mystring, j) j = mypos(x) + 1 Next col1 = Left(mystring, mypos(1)) col2 = Mid(mystring, mypos(1) + 1, mypos(r - 3) - (mypos(1) + 1)) col3 = Mid(mystring, mypos(r - 3) + 1, mypos(r - 2) - mypos(r - 3) - 1) col4 = Mid(mystring, mypos(r - 2) + 1, mypos(r - 1) - mypos(r - 2) - 1) col5 = Mid(mystring, mypos(r - 1) + 1, mypos(r) - mypos(r - 1) - 1) col6 = Right(mystring, Len(mystring) - mypos(r)) Range("C" & i).Resize(1, 6).Value = Array(col1, col2, col3, col4, col5, col6) j = 1 Next End Sub
Leo
Hi leo,
What a wonderful piece of work...works amazingly well...! Many thanks to you..
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks