Forcing a line break in a column in an EXCEL Spreadsheet - Excel 2007

I have a column that is a concatenation of multiple columns.  I would like to put these columns into one string.

In doing this is there a way to cause a line feed within a column.  This would be similar to the "<br />" in HTML.
   
If my string reads  "John Doe  Doctor   04/04/1962"

I would like to display
John Doe
Doctor
04/04/1962
moriniaAdvanced Analytics AnalystAsked:
Who is Participating?
 
Patrick MatthewsConnect With a Mentor Commented:
Replace:

Cast(row_created as nvarchar(11)) + ' - '

with:

Cast(row_created as nvarchar(11)) + CHAR(10)
0
 
leuqarteCommented:
add CHAR(10) as the character for a line break (as the equivalent of the BR tag)

http://www.dailydoseofexcel.com/archives/2004/10/19/line-breaks-in-formulas/
0
 
andrewssd3Commented:
You can use Char(10) as leuqarte suggested, e.g.
=CONCATENATE(A1,CHAR(10),B1,CHAR(10),C1)

Open in new window

, but it only works if you set the cell format to wrap text (Alignment...wrap text for pre-2007 Excel, or Wrap text from the Home tab for 2007/2010
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
moriniaAdvanced Analytics AnalystAuthor Commented:
Can Char(10) be put into a select statement

(Select fname + '  ' + lname ) as name
0
 
Elton PascuaCommented:
Hi Morinia,

Yes you can but what's the nature of the Select statement? What is the code trying to accomplish?
0
 
moriniaAdvanced Analytics AnalystAuthor Commented:
I have this select statment

, (Select cast(case_type_desc as nvarchar(25)) + ' - ' +  Cast(row_created as nvarchar(11)) + ' - ' + cast(system_login as nvarchar(20)) + ' - ' + cast(risk_level_desc as nvarchar(22)) + '        Case Closed: ' +  + cast(case_close_date as nvarchar(11)) + ' ' +  cast(close_reason_desc as nvarchar(50)))  as case_lit
From Cases

I would like to put a break after row_created, risk_level_desc, close_reason_desc
0
 
Elton PascuaCommented:
I'm sorry, this code is unfamiliar to me. Looks like an SQL statement not VBA.
0
 
moriniaAdvanced Analytics AnalystAuthor Commented:
It is SQL.  How would yo do it in VBA.  This is SQL running in EXCEL, so I can put VB code in.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.