How to remove carriage return symbol before importing into excel

C

confused

I have a VB 2005 application that imports title into excel; how do I
get it to not include the carriage return symbol's
this is the code:
I this code is in a function and gets called for every line that needs
to be included in the title heading.

mSubTitle += strFilter & ": " & strSubTitle & vbCrLf

I also tried this:
mSubTitle += strFilter & ": " & strSubTitle + Chr(13) + Chr(10)

When excel opens I get the title and at the end of every line is a
small square.
How do I make this work?
 
P

PCLIVE

Try removing the "Chr(13)". Also, you need to set the cell format to wrap.
mSubTitle = strFilter & ": " & strSubTitle & Chr(10)

The purpose of Chr(13) and Chr(10) is usually to include a line feed or hard
return. If you don't need that, then remove them both...or just get rid of
the Chr(13) or replace it with Chr(10) and format the cell to wrap as
mentioned before.

HTH,
Paul
 
C

confused

Try removing the "Chr(13)".  Also, you need to set the cell format to wrap.
mSubTitle = strFilter & ": " & strSubTitle & Chr(10)

The purpose of Chr(13) and Chr(10) is usually to include a line feed or hard
return.  If you don't need that, then remove them both...or just get ridof
the Chr(13) or replace it with Chr(10) and format the cell to wrap as
mentioned before.

HTH,
Paul

--









- Show quoted text -

Thanks, Paul I removed Chr(13) and used wraptext = true
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top