+ Reply to Thread
Results 1 to 7 of 7

save as CSV file on desktop but in a 'New folder'

  1. #1
    Registered User
    Join Date
    07-05-2012
    Location
    Ontario, Canade
    MS-Off Ver
    Excel 2010
    Posts
    88

    save as CSV file on desktop but in a 'New folder'

    Hey,

    I currently have a macro which takes the worksheets from one work book and saves them to the desktop as CSV files. works well. what i want now is to have the (9 new workbooks) saved into a created folder. so i need my code to create a new folder. and i want the folers name to specify from a cell in the origional workbook. the last part i already can do, i have set y = to that cells value. it works for my save as. now this is what i currently have:

    Please Login or Register  to view this content.
    I have the worksheets set up to go through as a string, so it selects on at a time and goes through the process of being compied into a new work book and then that is the save as code. how can i create a newfolder on the desktop with VBA? thanks,

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

    Re: save as CSV file on desktop but in a 'New folder'

    See if you can work with this

    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
    07-05-2012
    Location
    Ontario, Canade
    MS-Off Ver
    Excel 2010
    Posts
    88

    Re: save as CSV file on desktop but in a 'New folder'

    That works to create a file, how would i manipulate the code i have above to save the file in the folder? thanks

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

    Re: save as CSV file on desktop but in a 'New folder'

    Something like this

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-05-2012
    Location
    Ontario, Canade
    MS-Off Ver
    Excel 2010
    Posts
    88

    Re: save as CSV file on desktop but in a 'New folder'

    thanks, ive pretty much got it, I defined X as Activesheet.Name I want to save each worksheet as the activesheet name. but its only saving as X when sub in X for nameofyourfile anyideas. ive tried playing with the syntax aswell!

  6. #6
    Registered User
    Join Date
    07-05-2012
    Location
    Ontario, Canade
    MS-Off Ver
    Excel 2010
    Posts
    88

    Re: save as CSV file on desktop but in a 'New folder'

    This is what i have:
    Please Login or Register  to view this content.
    But that just saves as filenameactivesheetnam.

    This:
    Please Login or Register  to view this content.
    The syntax tells exel it is a text there for all workbooks save as X.CSV, any ideas?

  7. #7
    Registered User
    Join Date
    07-05-2012
    Location
    Ontario, Canade
    MS-Off Ver
    Excel 2010
    Posts
    88

    Re: save as CSV file on desktop but in a 'New folder'

    Solved it:

    Please Login or Register  to view this content.

+ 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