View Single Post
  #4  
Old April 16th, 2009, 03:13 PM posted to microsoft.public.excel.worksheet.functions
Glenn[_6_]
external usenet poster
 
Posts: 1,245
Default Split text file into Excel sheet and separate the final resultsinto a new sheet

Luciano Paulino da Silva wrote:
Dear Glenn,
I'm having some problemas. Some of your stepes suggestions seems that
they did not work fine with me. Would it be possible that you send me
a sample sheet?
Thanks in advance,
Luciano



http://www.savefile.com/files/2079043

I had to make some small modifications to the formulas to handle leading spaces
in the data I copied from your original message. Not sure if they are present
in the actual data or not, but if they are it should work now.

C2 = IF(D2="","",IF(C1="",A1,C1))

D2 = IF(ISERROR(FIND(" ",A2)),"",TRIM(LEFT(TRIM(A2),
FIND(" ",TRIM(A2)))))

E2 = TRIM(MID(SUBSTITUTE(SUBSTITUTE(TRIM(A2)," ",
REPT(" ",99),2)," ",REPT(" ",99),1),99,99))

F2 = TRIM(MID(SUBSTITUTE(SUBSTITUTE(TRIM(A2)," ",
REPT(" ",99),3)," ",REPT(" ",99),2),99,99))

G2 = TRIM(MID(SUBSTITUTE(TRIM(A2)," ",REPT(" ",99),3),99,99))
Ads