+ Reply to Thread
Results 1 to 11 of 11

exporting data to new excel adding " "

  1. #1
    Forum Contributor
    Join Date
    03-10-2017
    Location
    USA
    MS-Off Ver
    office 2016
    Posts
    393

    exporting data to new excel adding " "

    I have some data that looks like this


    Cer3R
    Cer4,5L

    when use a vba program to copy and paste it on a new excel sheet it comes out like this

    1L - Cer3R
    "1L - Cer4,5L"

    any idea why it adds the " " when there is a , in there?

    im using this to copy to new sheet

    Please Login or Register  to view this content.
    Last edited by kevinu; 11-18-2019 at 11:32 PM.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,459

    Re: exporting data to new excel adding " "

    Perhaps post a sheet?

  3. #3
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,316

    Re: exporting data to new excel adding " "

    Excel always does that when saving a workbook as a text file. You'll have to use an alternative method to create the text file.
    Everyone who confuses correlation and causation ends up dead.

  4. #4
    Forum Contributor
    Join Date
    03-10-2017
    Location
    USA
    MS-Off Ver
    office 2016
    Posts
    393

    Re: exporting data to new excel adding " "

    Here is an exmaple file. All i really care about is that the exported text does not have " " around entries with a , in them. Everything else is fine. We had a new update to our parent software and it now has some values with , in them.
    Attached Files Attached Files

  5. #5
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: exporting data to new excel adding " "

    Simplest thing is changing:

    Cer4,5L into Cer4.5L

    then no more "" around in TXT file.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  6. #6
    Forum Contributor
    Join Date
    03-10-2017
    Location
    USA
    MS-Off Ver
    office 2016
    Posts
    393

    Re: exporting data to new excel adding " "

    Thanks Kokosek, That does work, unfortunately the data comes to me with a comma and it requires a comma when i import my exported data back to it.

  7. #7
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Re: exporting data to new excel adding " "

    Can you change it from a comma to a period during the save to text? And then modify your input script to change it back?

    Please Login or Register  to view this content.

  8. #8
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: exporting data to new excel adding " "

    Expanding on KOKOSEK's suggestion:
    a. Change the Comma to a pattern (e.g. 'qqq' or a character '~' that you never use)
    b. When you import the text file, do a Universal replace of the pattern or character with a comma

    For example:
    Please Login or Register  to view this content.
    Lewis

  9. #9
    Forum Contributor
    Join Date
    03-10-2017
    Location
    USA
    MS-Off Ver
    office 2016
    Posts
    393

    Re: exporting data to new excel adding " "

    I like the idea. I can get it to replace , with . then copy it to a new worksheet. Is there a way to replace the . with , after copying it before closing it out within the code above? I ask because I dont have access to change the parent program that imports it so i cant change it during import.

  10. #10
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: exporting data to new excel adding " "

    Is there a way to replace the . with , after copying it before closing it out within the code above?
    We were barking up the wrong tree. There is a simple solution without doing a replace.

    Change:
    Please Login or Register  to view this content.
    Reference: https://docs.microsoft.com/en-us/off...orkbook.saveas

    Thanks for the rep points.

    Lewis

  11. #11
    Forum Contributor
    Join Date
    03-10-2017
    Location
    USA
    MS-Off Ver
    office 2016
    Posts
    393

    Re: exporting data to new excel adding " "

    Brilliant !!!!!! that did it.. thanks a lot

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Adding data in to 2 different worksheets "FSI" and "Non-FSI"
    By happyz in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 01-07-2018, 10:18 AM
  2. [SOLVED] Excel 2010 -- "Visual Basic" "Macros" and "Record Macro" all disabled.
    By NicholasL in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-07-2017, 06:11 AM
  3. [SOLVED] (Auto Exporting Emails to Excel) Script Only Runs Once; Possibly Related to Use of "End"
    By bacon1192 in forum Outlook Programming / VBA / Macros
    Replies: 17
    Last Post: 06-29-2015, 09:49 AM
  4. Adding multiple "find" with "left" /"Right"
    By Daniel1 in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 02-22-2014, 04:33 PM
  5. Replies: 0
    Last Post: 09-17-2012, 01:17 PM
  6. Replies: 7
    Last Post: 11-28-2006, 04:19 PM
  7. [SOLVED] exporting excel to csv large fields save as "####"
    By zzapper in forum Excel General
    Replies: 6
    Last Post: 06-25-2005, 05:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1