Thread: Use of Split
View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
keiji kounoike keiji kounoike is offline
external usenet poster
 
Posts: 199
Default Use of Split

Rick Rothstein wrote:
Another way to handle an unknown multiple number of Line Feeds...

TargetValue = Replace(WorksheetFunction.Trim(Replace(Replace(Tar get. _
Offset(0, 8), " ", Chr(1)), vbLf, " ")), Chr(1), " ")
frmTaskList.txtHeadLine.Value = Split(TargetValue, vbLf)(0)
frmTaskList.txtDescription.Value = Split(TargetValue, vbLf)(1)


I may be a bit dense, but i can't get what your formula is doing.
I think it seems like a typo. I might be wrong, but Is this what you
mean?

TargetValue =
Replace(Replace(WorksheetFunction.Trim(Replace(Rep lace(Target. _
Offset(0, 8), " ", Chr(1)), vbLf, " ")), " ", vbLf), _
Chr(1), " ")


No, you are not dense... I accidentally left out the step you provided
in your posting (namely, for those out there following this, converting
the now single space to a Line Feed before converting the Chr(1)
characters back to their original spaces). Thanks for catching that.


I'm from Japan and there is a proverb like this in Japan. In Japnese,
that is "Saru mo ki kara ochiru". translating it into English with words
to words, it would be "Even a monkey falls from trees". Equivalent to
this in English might be "Even Homer sometimes nods." but i'm not sure
whether it is right or wrong, beacause i'm not so good at English.

keiji