+ Reply to Thread
Results 1 to 6 of 6

How to export an excel file to csv with quotes

  1. #1
    Registered User
    Join Date
    06-12-2021
    Location
    Montreal, Canada
    MS-Off Ver
    Office 365
    Posts
    49

    How to export an excel file to csv with quotes

    Good day,

    Is there a process where I could export an excel file to csv but have quotes added to the export file.

    At the moment, after the export to csv, I use a text editor to search and replace the comma for quotes-comma-quotes.

    Tx for your help,

    Yves

  2. #2
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,225

    Re: How to export an excel file to csv with quotes

    Run the following code when the data sheet is active. The macro assumes that the tabular data starts from cell A1.
    Please Login or Register  to view this content.
    Artik

  3. #3
    Registered User
    Join Date
    06-12-2021
    Location
    Montreal, Canada
    MS-Off Ver
    Office 365
    Posts
    49

    Re: How to export an excel file to csv with quotes

    Tx Artik

    Is there a modification that would make the csv file location the same as the source file?

    Tx

    Yves

  4. #4
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,225

    Re: How to export an excel file to csv with quotes

    In my opinion, there is nothing to modify. The CSV file is saved in the same folder as the source file.

    Artik

  5. #5
    Registered User
    Join Date
    06-12-2021
    Location
    Montreal, Canada
    MS-Off Ver
    Office 365
    Posts
    49

    Re: How to export an excel file to csv with quotes

    Hi Artik,

    It does not on my system.

    I have the file sitting in c:\TEMP\TESTQUOTES\ and the TestCsvQuotes.csv is being written at C:\Users\yves.davignon\AppData\Roaming\Microsoft\Excel\XLSTART

    At first, I did not think the macro was working until I closed and re open excel. The file being in the XLSART folder, the csv open.

    Yves

  6. #6
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,225

    Re: How to export an excel file to csv with quotes

    From your description, I conclude that the source file is not the file from which you run the macro. In that case, you should change the reference from this workbook to the active workbook.
    Change the line:
    Please Login or Register  to view this content.
    Artik

+ 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] Convert Excel sheet to text file without extra quotes in my data file
    By chi05 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-11-2021, 10:10 PM
  2. [SOLVED] Export excel worksheet as csv with double quotes
    By jaryszek in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-14-2019, 05:26 AM
  3. [SOLVED] Import CSV file in Excel using ADODB when values in the file have double quotes
    By buran in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-23-2015, 12:51 PM
  4. Export text without quotes
    By adriles in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-15-2014, 01:48 PM
  5. [SOLVED] Double Quotes using Chr(34) and Extra Quotes when saving as text file
    By vamosj in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-26-2013, 12:26 PM
  6. export excel to text file; multiple line cells; no quotes
    By redbu11 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-11-2012, 01:57 AM
  7. Export to CSV with double quotes but ignore items that have quotes
    By capnhud in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-15-2010, 03:13 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