Thread: CR LF problem
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default CR LF problem (BTW)

I forgot to mention..... I would like all line break characters
to be the same throughout the entire string. Using
CRLF or vbCrLf will be fine. Or, just one CR is good.

As long as it's consistent all throughout the string.


Ok, so if you say there are possibly 2 cr characters together, but only
1 LF character regardless of how many Cr chars, then...

'delete all CRs
s = Replace(s, vbCr, "")

'replace all LFs with CRLFs
s = Replace(s, vbLf, vbCrLf)

OR

s = Replace(Replace(s, vbCr, ""), vbLf, vbCrLf)

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion