microsoft / advanced-formula-environment

Create, edit, and reuse formulas in Excel
https://aka.ms/get-afe
MIT License
109 stars 11 forks source link

Text copy and paste #63

Open KDean-Dolphin opened 9 months ago

KDean-Dolphin commented 9 months ago

I don't think this is AFE-specific but perhaps there's something you can do about it anyway.

I use an Excel table and the REDUCE() function to build an array that I paste into AFE. The result is a mess, because the value that is pasted is pasted as a quoted string instead of as I see the value in the cell. I've reduced the problem to the image below.

Cell A1 is a single line of text. Copying and pasting that into AFE works as expected: the content is pasted as displayed.

Cell A3 is multiple lines of text. Copying and pasting that into AFE doesn't work as expected: the content is pasted with double-quote characters around it.

These hold true whether the cells are literals or formula results.

The multiline problem gets really messy if the lines themselves contain double-quote characters, which get replaced with two double-quote characters.

image

jack-williams commented 9 months ago

I'm not sure whether there is something we can do in AFE, or at least not without writing some very custom code.

This thread describes the same problem, which seems to be Excel specific. https://superuser.com/questions/324271/how-to-copy-multi-line-text-from-excel-without-quotes