ChristianHWT - copied the below from ChristianHWT, i see that thread is closed and I am not sure why, this is a very relevant question causing a lot of frustration, please can Microsoft developers put a fix for this, i am using microsoft 365 and this is truly painful.
Hi,
I stumbled upon this problem recently and found that there are loads of people on the Internet having the same problem:
I have a cell with hard line breaks (not automatic word wrapping). When I copy & paste it to outside of Excel, double quotes are added to the beginning and end of the cell's content.
For example, the content
Test
123
will be pasted elsewhere as
"Test
123"
This is in my opinion a totally useless thing to do (no other program I ever used was doing that to text with line breaks) and ruins a calculation tool which I was creating, from where a resulting "report" should be copied to a web interface.
There are 2 accepted "solutions" on the Internet:
- Use Word as an intermediary, so copy the text to Word first and then to the target. That's an inefficient workaround at best.
- Use a Macro. I can't do that because of restrictions on documents containing Macros.
Since both solutions are not really acceptable for me, I did some experiments, using the CHAR() function to add other non-printable characters into the text instead of the line breaks. I found that Excel adds the quotes only to strings containing the non-printable characters 10 (line feed), 13 (carriage return) and 9 (tab). All other non-printable characters, such as 12 (form feed) or 30 (record separator) do NOT cause Excel to add quotes.
Obviously that doesn't help me since these characters do not create line breaks in my report, but it shows that some software developer working on Excel already some 20 years ago decided intentionally to add quotes to strings containing this 3 non-printable characters. And none of his successors working on any of the newer versions decided to change that...
Therefore my question now is: Why on earth is Excel doing this? Why? What reason could there be to do this? I really don't get it.