+ Reply to Thread
Results 1 to 5 of 5

VBA code to save only text with quote marks in a CSV

  1. #1
    Registered User
    Join Date
    04-29-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    3

    Question VBA code to save only text with quote marks in a CSV

    Hi,

    I have a 10 column worksheet with text in the first 9 columns (A to I) and a number in column 10 (J).

    I need to save this as a CSV with quote marks around the data in the first 9 columns and without quotes around the number in column 10.

    Found the attached macro code on the MS site, however it saves the data in all columns with quote marks. Can someone help with modifying it so it will do what I require?


    Please Login or Register  to view this content.
    Thanks
    Alan
    Attached Files Attached Files
    Last edited by Alanks; 07-10-2015 at 02:43 AM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,663

    Re: VBA code to save only text with quote marks in a CSV

    Please post the code directly to the forum, not in a txt file attachment.
    Use code tags: [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE]
    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    Also attach a sample of the data the macro operates on.
    • Click Advanced (next to quick post),
    • Scroll down until you see "Manage Attachments",
    • Click that then select "add files" (top right corner).
    • Click "Select Files" find your file, click "open" click "upload"
    • Once the upload is completed the file name will appear below the input boxes in this window.
    • Click "Done" at bottom right to close the Attachment Manager.
    • Click "Submit Reply"
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    04-29-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: VBA code to save only text with quote marks in a CSV

    Hi,

    Thanks for the help with posting correctly.
    Here is an example of the data I'm trying to save as a csv file in the manner described in my original post.

    Alan.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,663

    Re: VBA code to save only text with quote marks in a CSV

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-29-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: VBA code to save only text with quote marks in a CSV

    Good morning Ben,

    Thanks very much.
    The modified code does exactly what I need it to do.

    Alan.

+ 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] Getting rid of double quote marks using =SUBSTITUTE function
    By Sophie.Durrant in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-25-2014, 07:13 AM
  2. Getting Rid of Extra Quote Marks in Exported Text Files
    By gabrielhuebsch in forum Excel General
    Replies: 0
    Last Post: 04-07-2010, 01:27 PM
  3. [SOLVED] How to keep quote marks for CSV in excel
    By Matt in forum Excel General
    Replies: 0
    Last Post: 07-31-2006, 07:33 PM
  4. Excel to CSV: Formatting Quote Marks
    By Stephen in forum Excel General
    Replies: 2
    Last Post: 02-15-2006, 01:20 PM
  5. [SOLVED] How do you look for quote marks?
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-19-2005, 09:05 AM

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