+ Reply to Thread
Results 1 to 4 of 4

VBA to save multiple worksheets as separate CSV files using name of worksheet

  1. #1
    Registered User
    Join Date
    09-20-2012
    Location
    london, England
    MS-Off Ver
    Excel 2010
    Posts
    7

    VBA to save multiple worksheets as separate CSV files using name of worksheet

    Hi

    I tried to adopt Martin's code (from a separate thread) as my requirement was very similar. I have data in the following format per tab in excel 2010

    AC ME ACME CO
    Date PX_OPEN PX_HIGH PX_LOW PX_LAST
    27/09/2011 1108.23 1141.13 1075.33 1108.23
    28/09/2011 1130.33 1163.47 1097.19 1130.33
    29/09/2011 1145.81 1180.21 1111.40 1145.81

    i need to save each tab in excel as a .CSV file in a folder (any name will do). The number of tab's(worksheet's) will vary - anything from 1 to N tabs. So basically the vba would need to create N CSV files. Also - as the tab data will be updated daily - i would need to overwrite the old .CSV files.

    Any help - will be greatly appreciated.

    Many thanks

    ACTUALLY - APOLOGIES. I HAVE SORTED IT NOW. It was just to change the "CSV" name to "NAME" (as per spreadsheet)
    Last edited by Yg74; 09-20-2012 at 08:27 AM. Reason: fixed

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: VBA to save multiple worksheets as separate CSV files using name of worksheet

    Give this a try. Will save the files to the same directory as the workbook.


    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Registered User
    Join Date
    09-20-2012
    Location
    london, England
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: VBA to save multiple worksheets as separate CSV files using name of worksheet

    Many thanks Mike - works well

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: VBA to save multiple worksheets as separate CSV files using name of worksheet

    If you have solved your question (even if its done by you)

    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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