Forum Discussion

Edgar Soares's avatar
Edgar Soares
Copper Contributor
Feb 28, 2018

Extra and "double" double quotes when using carriage return in formulas

Hi, all.

I am attempting to copy Excel cell contents in a text file (for further use later).

However, when copying and pasting cells with formulas that contain both quotes ("") and carriage returns (either CHAR(13) or "Alt+Enter"), the result contains "extra" quotes at odd places.

For example, if formula is =[@Type] & [@[Callout Pipe 1]] (with no carriage returns), the result is (after pasting into Notepad):

SDMH12" CPP N IE= 320.8

Just as desired. However, we need a carriage return after "SDMH" (from column [@Type]), so if we simply add a carriage return (again, either CHAR(13) or "Alt+Enter") with this formula =[@Type] & CHAR(13) & [@[Callout Pipe 1]], pasting it in Notepad results in:

"SDMH

12"" CPP N IE= 320.8"

As can be seen, the return carriage worked, but my text now has three extra double quotes that weren't meant to be there.

Could anyone help me solve this problem?

Thanks in advance,

Edgar

3 Replies

  • LimehouseJohn's avatar
    LimehouseJohn
    Copper Contributor
    Edgar Soares wrote:

    the result contains "extra" quotes at odd places.

    This all used to work perfectly at one time then MS (with their usual wisdom - NOT!!!) screwed it all up but here is my workaround.  You need to take the text via an intermediate stage of copying and pasting it into MS Word.

    So, first copy your cells containing the quotes (standard ctrl+C) in Excel.  Paste the result into an empty MS Word document, making sure to "Keep the source formatting".  This results in a standard MS Word table (but without the extra double quote marks in the cells).  Next, select the whole table and then from the "Table Layout" menu which appears in the ribbon, select "Convert to text".  This results in the text within the MS Word table (and still without the extra quotes) appearing as just plain text in the document.  So, just select the whole text, then copy and paste it to wherever it is required (in my case it is some JavaScript lines computed in Excel for inclusion in an HTML file).  What a shambles MS are for making everyone jump through these hoops.

    Best regards

    John

  • SergeiBaklan's avatar
    SergeiBaklan
    Diamond Contributor

    Edgar Soares 

     

    Hi Edgar,

     

    That's only using workarounds. It could be macro https://excel.tips.net/T002237_Getting_Rid_of_Extra_Quote_Marks_in_Exported_Text_Files.html. Or copy paste through Word, or first paste as value into another cell, copy it content in edit mode and paste into Notepad then. Perhaps something else. That's lot of posts about the issue, e.g. https://superuser.com/questions/324271/how-to-copy-multi-line-text-from-excel-without-quotes

  • Licuc's avatar
    Licuc
    Copper Contributor

    Edgar Soares

     

    Hi all

    I have the same issue. I need copy data from Excel to an ERP using copy/paste

     

    A1 = AA

    B2 = BB

    A1&A2 is ok in Notepad++   : AABB

    with A1&char(9)&B2 I have "AA ->BB"

     

    I am also searching how to remove the double quotes

     

    Thanks for help

     


    Edgar Soares wrote:

    Hi, all.

    I am attempting to copy Excel cell contents in a text file (for further use later).

    However, when copying and pasting cells with formulas that contain both quotes ("") and carriage returns (either CHAR(13) or "Alt+Enter"), the result contains "extra" quotes at odd places.

    For example, if formula is =[@Type] & [@[Callout Pipe 1]] (with no carriage returns), the result is (after pasting into Notepad):

    SDMH12" CPP N IE= 320.8

    Just as desired. However, we need a carriage return after "SDMH" (from column [@Type]), so if we simply add a carriage return (again, either CHAR(13) or "Alt+Enter") with this formula =[@Type] & CHAR(13) & [@[Callout Pipe 1]], pasting it in Notepad results in:

    "SDMH

    12"" CPP N IE= 320.8"

    As can be seen, the return carriage worked, but my text now has three extra double quotes that weren't meant to be there.

    Could anyone help me solve this problem?

    Thanks in advance,

    Edgar


     

     

     

Resources