Forum Discussion
g-00000
Mar 12, 2024Copper Contributor
How to replace without destroying formatting and in-cell-linebreak?
I want what in the red circle. Using replace in excel destroys formating. Using replace in word doesn't destroy formating, but pasting back to excel destroys linebreaks in one cell (alt+enter...
wdx223_Daniel
Mar 13, 2024Brass Contributor
=textjoin(char(10),,let(a,textsplit(j1,char(10)),if(right(a)=":","",a)))
g-00000
Mar 13, 2024Copper Contributor
This destroys both formatting and linebreak.
- peiyezhuMar 13, 2024Bronze Contributor
Have you tested the formula?
I recommend you upload a test file.
As far as I know the formular provided by wdx223_Daniel keep line break at least.
Other format, i.g. bold font or blue color font may disappear.
If you want precise the format,I guess you need parse and formatting .- g-00000Mar 13, 2024Copper Contributor
Want to upload file, but this website says "The file type (.xlsx) is not supported". I'll describe by text:
Line breaks are alt+enter.
In the question's file, line breaks were made through
=D1&CHAR(10)&"例:"&E1&CHAR(10)&"近:"&F1&CHAR(10)&"派:"&G1After combining the previous cells together, I added formatting manually.