Forum Discussion
Help with Excel 'Format copy' does not include 'new line (Alt Enter) within a cell.
a 'new line' (Alt Enter) is just text not formatting. The only 'formatting' to be 'copied' would be word wrap which is related but different. Word wrap (in the alignment grouping on the home tab) will wrap text inside a cell when it reaches the end of the cell. If excel detects a 'new line' character in the text it will typically turn word wrap on and that character will force a line break before it necessarily reaches the end of the cell. A cell with a 'new line' character in it but with word wrap turned off will NOT go to a new line.
I do not know what you mean by 'Format copy' but if you copy a cell with word wrap turned on and paste formatting onto another cell it will turn word wrap on. Also if you use the format painter it will also turn it on.
With Word Wrap ‘On’ within a cell I still need to force a ‘new line’ by using keys: [Alt] [Enter] (I consider this part of formatting, since it impacts how the text is ‘displayed’).
How to keep this same display when copying from cell to cell?
- m_tarlerJun 25, 2025Bronze Contributor
As I said, the actual formatting (word wrap on) does get 'painted'. If you copy a cell that has a 'new line' character, that 'new line' character will also get copied over. the format painter can NOT arbitrarily insert a new line character into another cell. it would have no idea where to insert it. YOU can create a formula using SUBSTITUTE or REPLACE or other text functions to 'insert' a CHR(10) character according to what ever 'rule' you need.
- pspisarJun 25, 2025Copper Contributor
Left side is the desired 'formatting'.
Right side is result when I use 'format painter'.
It seems to me that 'format painter' should be able to determine location of 'new line' (ie: CHR(10)) and place in the same locations, right?
- m_tarlerJun 26, 2025Bronze Contributor
no it will not insert text and chr(10) is a text character. Just looking at it I don't necessarily know where either. For exmple:
Will it always break before the "EQ", "EVB" and the "FIB"? if so the following formula will insert the CHAR(10) character:
=REGEXREPLACE(A1,"_([E,F])","_"&CHAR(10)&"$1")Is it always after the 1st, 3rd and 6th underscore? Then maybe this:
=REDUCE(A14,{1,3,6},LAMBDA(p,q,SUBSTITUTE(p,"_","_"&CHAR(10),q)))and if you want an arbitrary break after any "_" if the line exceeds some number of characters try this (number of characters set to 18 on line 4):
=LET( in, A14, _LF, {"_"}, _LL, 18, inArray, REDUCE(in, _LF, LAMBDA(p, q, TEXTSPLIT(p, q) & q)), TEXTJOIN( CHAR(10), 1, REDUCE( {""; ""}, inArray, LAMBDA(p, q, LET( pp, DROP(p, -1), pn, TAKE(p, -1), IF(LEN(pn & q) < _LL, VSTACK(pp, "", pn & q), VSTACK(p, q)) ) ) ) ) )but as you can see there are lots of possible ways to 'interpret' where you want/mean for a line feed to be put. If any of the above are correct you can use them in an adjacent column and either hide the original or copy and 'paste values only' to get your output (don't forget to make sure 'wrap text' is turned on)
if you find this your best answer feel free to mark as solution and if you appreciate my responses likes are always welcome.