+ Reply to Thread
Results 1 to 5 of 5

VBA - Saving a file to .csv

  1. #1
    Registered User
    Join Date
    02-14-2013
    Location
    Wisconsin, USA
    MS-Off Ver
    Excel 2010
    Posts
    55

    VBA - Saving a file to .csv

    I would like to save a file .csv format using pipe delimited. Currently I will change the region and settings list separator on my computer to a pipe then save the file as .csv. I have to keep doing this tho, every time i run that file. Is there a way in vba to do this usine the .saveas function. I could probably do a find and replace to, but would like to avoid that as well.

    thanks,
    Mike

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: VBA - Saving a file to .csv

    The only way I know of doing this is to create a new workbook, concatentate the data into single cell rows with a "pipe" delimiter in that book and then save that workbook as a txt file (with .csv as the extension).

  3. #3
    Registered User
    Join Date
    02-14-2013
    Location
    Wisconsin, USA
    MS-Off Ver
    Excel 2010
    Posts
    55

    Re: VBA - Saving a file to .csv

    I'm surprised there isn't any easy way to do this. Searching all over the internet and there isn't a simple answer. It's not the end of the world, but it would erase one extra step in the procee. Thanks for the idea.

  4. #4
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: VBA - Saving a file to .csv

    The new workbook solution can be solved using VBA to automate the whole process however theres also no reason why you cant cycle through your cells and write them independantly out to a .csv file inserting pipe chars between each cell. Its a bit more code than a standard transferspreadsheet line of code but fairly easily done, it just depends on your workbook setup.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: VBA - Saving a file to .csv

    Maybe

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

+ 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. Replies: 11
    Last Post: 08-23-2014, 01:28 PM
  2. Replies: 5
    Last Post: 09-13-2012, 11:50 AM
  3. Problem saving Excel file that copies an embedded object from a separate file
    By bhodge10 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-16-2012, 02:47 PM
  4. Creating a .txt file extracting information from a Excel file saving as .resx file
    By AbdallahHajbed in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-19-2012, 09:00 AM
  5. Saving multi-tab excel file created from comma delimited text file
    By Marcus Aurelius in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-19-2005, 01:20 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