Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default How do I insert a hard break (alt enter) in a concatenated string

I'm trying to insert a break at a particular point in text that is combined
using concatenate. The text is being used as column headings and I was hoping
to have some consistency in appearance to make the information easier to
read. The length of the pieces of combined text are of differing lengths. The
column widths are generally the same but do occasionally vary.

Any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 857
Default How do I insert a hard break (alt enter) in a concatenated string

Use CHAR(13) and CHAR(10) to insert a new line. For example, this will
concatenate the contents of A1 and B1. B1 will be on the line below A1.

=CONCATENATE(A1,CHAR(13),CHAR(10),B1)

Note that you need to turn on "Wrap text" for the cell. (Format-Cells, in
the Alignment tab, check "Wrap text").




"Alphafiction" wrote:

I'm trying to insert a break at a particular point in text that is combined
using concatenate. The text is being used as column headings and I was hoping
to have some consistency in appearance to make the information easier to
read. The length of the pieces of combined text are of differing lengths. The
column widths are generally the same but do occasionally vary.

Any ideas?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default How do I insert a hard break (alt enter) in a concatenated string

Would you explain the necessity of Char(13)?

I don't see any need for it at all!

All it gives me is an additional character (square) after the contents of
A1.

--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Vergel Adriano" wrote in message
...
Use CHAR(13) and CHAR(10) to insert a new line. For example, this will
concatenate the contents of A1 and B1. B1 will be on the line below A1.

=CONCATENATE(A1,CHAR(13),CHAR(10),B1)

Note that you need to turn on "Wrap text" for the cell. (Format-Cells,
in
the Alignment tab, check "Wrap text").




"Alphafiction" wrote:

I'm trying to insert a break at a particular point in text that is
combined
using concatenate. The text is being used as column headings and I was
hoping
to have some consistency in appearance to make the information easier to
read. The length of the pieces of combined text are of differing lengths.
The
column widths are generally the same but do occasionally vary.

Any ideas?



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 857
Default How do I insert a hard break (alt enter) in a concatenated str

RD,

I'm not sure if I can explain it very well but I will try. Char(13) is the
ascii carriage return character while Char(10) is the linefeed character. In
an ANSI encoded file, the new line character is two bytes (13 followed by
10). In a UTF-8 or unicode file, the new line character is just one byte and
that is char(10).

You can try it by trying this formula:

=CONCATENATE(A1,CHAR(13),CHAR(10),B1)

Copy the cell and paste in Notepad. Then, try this:

=CONCATENATE(A1,CHAR(10),B1)

Copy the cell and paste in Notepad. I think you'll see the difference.

I don't know why you're getting the square symbol though..


"Ragdyer" wrote:

Would you explain the necessity of Char(13)?

I don't see any need for it at all!

All it gives me is an additional character (square) after the contents of
A1.

--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Vergel Adriano" wrote in message
...
Use CHAR(13) and CHAR(10) to insert a new line. For example, this will
concatenate the contents of A1 and B1. B1 will be on the line below A1.

=CONCATENATE(A1,CHAR(13),CHAR(10),B1)

Note that you need to turn on "Wrap text" for the cell. (Format-Cells,
in
the Alignment tab, check "Wrap text").




"Alphafiction" wrote:

I'm trying to insert a break at a particular point in text that is
combined
using concatenate. The text is being used as column headings and I was
hoping
to have some consistency in appearance to make the information easier to
read. The length of the pieces of combined text are of differing lengths.
The
column widths are generally the same but do occasionally vary.

Any ideas?




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default How do I insert a hard break (alt enter) in a concatenated str

Agreed ... in Notepad the results are as requested ... BUT ... in XL02 ...
The Char(13) is superflouous, and in reality, erroneous, as it creates an
unsolicited character.
--

Regards,

RD
-----------------------------------------------------------------------------------------------
Please keep all correspondence within the Group, so all may benefit !
-----------------------------------------------------------------------------------------------

"Vergel Adriano" wrote in message
...
RD,

I'm not sure if I can explain it very well but I will try. Char(13) is the
ascii carriage return character while Char(10) is the linefeed character.
In
an ANSI encoded file, the new line character is two bytes (13 followed by
10). In a UTF-8 or unicode file, the new line character is just one byte
and
that is char(10).

You can try it by trying this formula:

=CONCATENATE(A1,CHAR(13),CHAR(10),B1)

Copy the cell and paste in Notepad. Then, try this:

=CONCATENATE(A1,CHAR(10),B1)

Copy the cell and paste in Notepad. I think you'll see the difference.

I don't know why you're getting the square symbol though..


"Ragdyer" wrote:

Would you explain the necessity of Char(13)?

I don't see any need for it at all!

All it gives me is an additional character (square) after the contents of
A1.

--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Vergel Adriano" wrote in
message
...
Use CHAR(13) and CHAR(10) to insert a new line. For example, this will
concatenate the contents of A1 and B1. B1 will be on the line below A1.

=CONCATENATE(A1,CHAR(13),CHAR(10),B1)

Note that you need to turn on "Wrap text" for the cell. (Format-Cells,
in
the Alignment tab, check "Wrap text").




"Alphafiction" wrote:

I'm trying to insert a break at a particular point in text that is
combined
using concatenate. The text is being used as column headings and I was
hoping
to have some consistency in appearance to make the information easier
to
read. The length of the pieces of combined text are of differing
lengths.
The
column widths are generally the same but do occasionally vary.

Any ideas?








  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default How do I insert a hard break (alt enter) in a concatenated string

=A1&CHAR(10)&B1

Don't forget that you will also need to set wrap text on the cell and make
the row high enough.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Alphafiction" wrote in message
...
I'm trying to insert a break at a particular point in text that is
combined
using concatenate. The text is being used as column headings and I was
hoping
to have some consistency in appearance to make the information easier to
read. The length of the pieces of combined text are of differing lengths.
The
column widths are generally the same but do occasionally vary.

Any ideas?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto-Insert Line Break (Alt+Enter)? o1darcie1o Excel Discussion (Misc queries) 4 October 25th 06 08:29 PM
Splitting a concatenated string into separate rows... Natarajan Excel Worksheet Functions 1 May 4th 06 05:57 PM
How do I break up a concatenated text string ? Bhobhojani Gudo Excel Discussion (Misc queries) 2 March 3rd 06 07:57 AM
Bold a portion of concatenated string joeeng Excel Discussion (Misc queries) 1 December 8th 05 08:26 PM
specify range name in formula with concatenated string Lori H Excel Worksheet Functions 2 July 19th 05 03:07 PM


All times are GMT +1. The time now is 03:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"