RE: $$Excel-Macros$$ Split text in cell

2012-03-22 Thread Rajan_Verma
Ms-Exl-Learner . Sent: Mar/Thu/2012 11:13 To: excel-macros@googlegroups.com Subject: Re: $$Excel-Macros$$ Split text in cell Another Approach Copy and paste the below formula in 2nd Row of any cell other than A2 cell and drag it below. =IF((LEN(TRIM(A2))-LEN(SUBSTITUTE(TRIM(A2)," ","&

Re: $$Excel-Macros$$ Split text in cell

2012-03-22 Thread Ms-Exl-Learner .
Another Approach Copy and paste the below formula in 2nd Row of any cell other than A2 cell and drag it below. =IF((LEN(TRIM(A2))-LEN(SUBSTITUTE(TRIM(A2)," ","")))>1, TRIM(MID(TRIM(A2), FIND(" ",TRIM(A2))+1, (FIND("^",SUBSTITUTE(TRIM(A2)," ","^",(LEN(TRIM(A2))-LEN(SUBSTITU

Re: $$Excel-Macros$$ Split text in cell

2012-03-22 Thread dguillett1
Macro looks for 1st space and last space and gets what is between. Don Guillett Microsoft MVP Excel SalesAid Software dguille...@gmail.com From: L.K. Modi Sent: Wednesday, March 21, 2012 11:23 PM To: excel-macros@googlegroups.com Subject: Re: $$Excel-Macros$$ Split text in cell Dear All, Its

Re: $$Excel-Macros$$ Split text in cell

2012-03-21 Thread Maries
Hi, PFA. =MID(A2,FIND(" ",A2,1)+1,LEN(A2)-MATCH(" ",LEFT(RIGHT(A2,{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}),1),0)-FIND(" ",A2,1)) Regards, MARIES. On 3/22/12, L.K. Modi wrote: > Dear All, > > Its good to see this resolution but can anyone explain this in simple > way > > Regards > Modi > > >

Re: $$Excel-Macros$$ Split text in cell

2012-03-21 Thread L.K. Modi
Dear All, Its good to see this resolution but can anyone explain this in simple way Regards Modi On Thu, Mar 22, 2012 at 4:51 AM, dguillett1 wrote: > Option Explicit > Sub getmiddleSAS() > Dim c As Range > Dim fs As Long > Dim ls As Long > For Each c In Range("a2:a10") > c = Applic

Re: $$Excel-Macros$$ Split text in cell

2012-03-21 Thread dguillett1
Option Explicit Sub getmiddleSAS() Dim c As Range Dim fs As Long Dim ls As Long For Each c In Range("a2:a10") c = Application.Trim(c) fs = InStr(c, " ") ls = InStrRev(c, " ") c.Offset(, 1) = Mid(c, fs, ls - fs) Next c Columns("b").AutoFit End Sub Don Guillett Microsoft MVP Excel SalesAid Software