Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2 columns into 1 excel cell with line break

Status
Not open for further replies.

smgs

MIS
Jul 8, 2002
8
0
0
US
I have 2 columns, Payee1 and Payee2. I want to export them to excel and have them appear in 1 cell, under each other:

Janice Smith
Smithsonian Museum

This would be the equivalent of entering them into a spreadsheet cell directly using Alt/Enter to break the lines. Can I insert the equivalent of Alt/enter into a concatenated string: Payee1 + ?? + payee2

If not, how?

 
Creat a formula with the following syntax:

{FILE.PAYEE1}+CHR(13)+{FILE.PAYEE2}

Use the formula instead of the individual fields. This puts a hard carriage return after the first field.
 
Tried your solution in Basic:

formula = leadingCaps ({FORM_PRF_ALL_V.PAYEE_ADDRESS1}) + chr(13) + leadingCaps ({FORM_PRF_ALL_V.PAYEE_ADDRESS2})

But excel does not recognize the break

More help, please.
 
Dond's solution works in Excel with the Crystal syntax preserved. I tried it in 97, and Excel respects the chr(13) part of the formula.

What version of Excel are you using?

Naith

 
I am using basic syntax into excel 97 sr2, exporting it as excel 8.0 extended
 
There isn't a leadingcaps in Crystal Reports that I've heard of, is this a UFL???

Dond12 explained this perfectly, just use crystal syntax.

If you get into trouble with having over 254 characters, (you example states payee1 and payee2 the first time, then addresses the second time) create separate formulas for each field, and place them into a text object with a chr(13) formula field in between.

-k kai@informeddatadecisions.com
 
Yes, leadingCaps is a UFL; it works fine except it is rigid, so Mary smith MD becomes Mary Smith Md, etc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top