Line breaks within a Cell

%3CLINGO-SUB%20id%3D%22lingo-sub-2468827%22%20slang%3D%22en-US%22%3ELine%20breaks%20within%20a%20Cell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2468827%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20some%20text%20(in%20.txt%20format)%20that%20I%20wish%20to%20enter%20into%20a%20cell.%26nbsp%3B%20The%20text%20contains%20%22new%20lines%22%20(hex%200A%20I%20think)%20and%20as%20a%20result%20a%20copy%20and%20paste%20approach%20makes%20the%20text%20enter%20into%20several%20cells%20in%20a%20column%20instead%20of%20just%20one%20cell.%26nbsp%3B%20How%20do%20I%20insert%20all%20this%20text%20into%20the%20one%20cell%3F%3C%2FP%3E%3CP%3EI%20have%20tried%20inserting%20an%20%3CALT%3E%3CENTER%3E%20into%20the%20text%20first%20in%20place%20of%20the%20strait%20return%20but%20this%20doesn't%20do%20the%20job.%3C%2FENTER%3E%3C%2FALT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20using%20Excel%202016%20for%20the%20Mac.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2468827%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%20on%20Mac%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2468904%22%20slang%3D%22en-US%22%3ERe%3A%20Line%20breaks%20within%20a%20Cell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2468904%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F272786%22%20target%3D%22_blank%22%3E%40davjam2019%3C%2FA%3E%26nbsp%3BMake%20sure%20you%20switch%20on%20Wrap%20text%20for%20all%20cells%20that%20contain%20the%20line%20feeds%20(Alt-Enter%20or%20CHAR(10)%20).%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2468971%22%20slang%3D%22en-US%22%3ERe%3A%20Line%20breaks%20within%20a%20Cell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2468971%22%20slang%3D%22en-US%22%3EAll%20cells%20in%20the%20sheet%20are%20formatted%20to%20%22text%22%20and%20%22wrap%22.%3CBR%20%2F%3EThe%20text%20file%20is%20created%20in%20Apple%20Notepad.app%20and%20the%20line%20feeds%20are%20type%20in%20as%20%3CALT%3E%3CENTER%3E.%20I%20have%20checked%20the%20hex%20code%20(using%20another%20program)%20and%20the%20line%20feeds%20are%20hex%200A%20decimal%2010.%3CBR%20%2F%3EIt's%20not%20working...%20%3CLI-EMOJI%20id%3D%22lia_disappointed-face%22%20title%3D%22%3Adisappointed_face%3A%22%3E%3C%2FLI-EMOJI%3E%3C%2FENTER%3E%3C%2FALT%3E%3C%2FLINGO-BODY%3E
New Contributor

I have some text (in .txt format) that I wish to enter into a cell.  The text contains "new lines" (hex 0A I think) and as a result a copy and paste approach makes the text enter into several cells in a column instead of just one cell.  How do I insert all this text into the one cell?

I have tried inserting an <alt><enter> into the text first in place of the strait return but this doesn't do the job.

 

I am using Excel 2016 for the Mac.

5 Replies

@davjam2019 Make sure you switch on Wrap text

Screenshot 2021-06-22 at 12.10.22.png

for all cells that contain the line feeds (i.e. Alt-Enter or CHAR(10) ).

All cells in the sheet are formatted to "text" and "wrap".
The text file is created in Apple Notepad.app and the line feeds are type in as <alt><enter>. I have checked the hex code (using another program) and the line feeds are hex 0A decimal 10.
It's not working...

@davjam2019 On a Mac myself. Don't really know which app you refer to. Can you upload an example of a text file with line feeds and explain how you would want to show it in Excel.

I have finally managed to make a short 4 line text to paste into one cell. But I notice anything greater than 25.5 lines isn't visible - the max line height appears to be 409 pix. The app I referred to is the Notepad app that comes with the Mac. It's an Apple app that is very useful for creation of small .txt files.

The reason I need this is that I am creating csv files using Excel to upload onto a database. These files have a heading and a body. The heading is general stuff such as filename, owner, date etc plus a comments field which is what I'm trying to fill with this text. The body is the normal record lines with fields of data. So the whole thing is formatted "text" and "wrap" (with the exception of two "date" fields in the header.
I think I may have to simply add the text I need into the comments field in the csv file after I create it!

@davjam2019 Sorry! Have no clue what you are talking about.