Line break within a cell

Discuss the spreadsheet application
Post Reply
gg39au
Posts: 3
Joined: Tue Jul 15, 2008 9:41 pm

Line break within a cell

Post by gg39au »

2012-Jun-16-Sat 1004
Windows 7
I want to make a line break within a cell. The Help gives wrong information. It says to press Enter. That goes to next cell as in Excel. I've tried Shift+Enter, Cnrl+Enter, Insert Formatting Mark. None work.
Thanks
George
OOo 2.3.X on MS Windows Vista
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: line break within a cell

Post by acknak »

The only way to enter a line break is when you edit the text in the cell: double-click on the cell itself and you can enter a line break by typing Ctrl+Enter. It doesn't work when you're typing in the formula toolbar.
AOO4/LO5 • Linux • Fedora 23
TetsuManga
Posts: 1
Joined: Wed Dec 19, 2012 1:33 pm

Re: Line break within a cell

Post by TetsuManga »

With Mac OS, it's [ cmd + enter ]. Within the cell, natch. Cheers
OpenOffice 3.4.1 [AOO341m1 (Build: 9593) ??? Rev. 1372282, 2012-08-12 09.53.18 (Mon 13 Aug 2012)]
Mac OS 10.8.1
captainacronym
Posts: 1
Joined: Tue Nov 19, 2013 6:01 pm

Re: Line break within a cell

Post by captainacronym »

This however, doesn't work in a formula...limiting its usefulness. :?
OpenOffice 4.0.1 MacOS Maverics
User avatar
kbellis
Posts: 58
Joined: Sat May 28, 2011 6:25 pm
Location: Ellsworth, ME

Re: line break within a cell

Post by kbellis »

acknak wrote:The only way to enter a line break is when you edit the text in the cell: double-click on the cell itself and you can enter a line break by typing Ctrl+Enter. It doesn't work when you're typing in the formula toolbar.
Thank you for this tip. In error, I kept wanting to Shift+Enter.
LO6222(x64) • AOO416 • Windows 10 Pro, 64-bit
User avatar
Zizi64
Volunteer
Posts: 11361
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Line break within a cell

Post by Zizi64 »

captainacronym wrote:This however, doesn't work in a formula...limiting its usefulness. :?

Code: Select all

=CONCATENATE("First line";CHAR(10);"Second line")
The height of row will not aligned automatically to the 'linebreaked' text.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Lupp
Volunteer
Posts: 3553
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Line break within a cell

Post by Lupp »

The row height for a row containing a cell with a CHAR(10) inside (or losing it again) will automatically adjust if the cell is set to the format property 'Alignment' > 'Wrap text automatically'. This does not depend on whether the linebreak was inserted by editing or by formula evaluation.
This will, of course, not apply to rows for which a row height is explicitly set.
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
Phillip
Posts: 102
Joined: Wed Jan 09, 2013 1:50 pm

Re: Line break within a cell

Post by Phillip »

In Office 4.1.4, when entering text into a cell for the first time, Cntrl+Enter also gives a line break.
I do not know when this was fixed.
Last edited by Phillip on Mon Nov 20, 2017 9:36 pm, edited 1 time in total.
Open Office 4.1.11, Windows 7 Professional 64-bit
User avatar
Lupp
Volunteer
Posts: 3553
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Line break within a cell

Post by Lupp »

As this thread got nearly 50 000 views to date (which means a very high rank), and the situation has changed since the original question was posted, I would lik to give a compendium of the current state (as of 2017-11-20, AOO V 4.1.3):

-1- To enter a line feed (hard line break) while editing the text content of a cell in Calc Ctrl+Enter must be pressed (On Mac: Cmd+Enter).
-2- The effect is achieved in Calc by inserting an actual character into the text. This character is the classical ASCII LF, code=10. You may also say U+000A.
-3- If you paste a piece of text copied from a Writer document and containing hard line breaks into a Calc cell (Ctrl+V) the line break is replaced by an ordinary space U+0020.
-4- Pasting (Ctrl+V) a piece of Writer text containing paragraph breaks into a single cell is not supported. More than one cells are used in this case. 'Paste Special...' not allowed.
[-4a- Recent LibO prompts for a selection if 'Paste Special...' (Ctrl+Shift+V) is used]
-5- Already for a long time now line breaks inside cells can also be generated by formulas returning texts.
-5a- It makes no difference in the appearance which one of the following insertions you use: CHAR(10), CHAR(13), CHAR(10) immediately followed by CHAR(13), CHAR(13) immediately followed by CHAR(10).
-5b- The inserted combinations CR+LF or LF+CR are, however, not merged in the resulting string, but only for the view. Adding 2 to LEN()!
-5c- Subsequent line breaks will result from subsequent insertions of any two of the mentioned (except any single CR+LF / LF+CR pair).
-6- If we analyse the .Text property of a cell by enumerating the paragraphs we find that what we called line breaks actually is handled as paragraph breaks.

This is not based on a specification. I don't even know if such a thing exists at all. The compendium is based on experience / experimental research.
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
Gjm02
Posts: 1
Joined: Mon Jan 17, 2022 12:56 pm

Re: Line break within a cell

Post by Gjm02 »

My work arround
Open EXCEL add 2nd line to cell with Ctr+enter save
Open with LibreOfice !
Open office 3.1
Phillip
Posts: 102
Joined: Wed Jan 09, 2013 1:50 pm

Re: Line break within a cell

Post by Phillip »

I see your signature says you are using Open Office 3.1. As Ctrl+Enter works fine in v4, I suggest you update.
Open Office 4.1.11, Windows 7 Professional 64-bit
Post Reply