+ Reply to Thread
Results 1 to 6 of 6

Macro to Create a set of folders and copy the active workbook

  1. #1
    Forum Contributor
    Join Date
    02-16-2008
    Location
    Mansfield, TX
    Posts
    324

    Macro to Create a set of folders and copy the active workbook

    Hello, I am at a loss as to how to create this macro. I need the user to be able to click a button and it will create the folder "C:\Documents and Settings\LOCALUSER\My Documents\Checkouts\2009" with a subfolder for Jan through Dec. In these subfolders, I need to copy the attached workbook four times with the file names "Week 1" through "Week 4" except in March, June, September, and December I need files with names "Week 1" through "Week 5".

    I can record and edit simple macro's but this is way over my head so I appreciate any help I can get.

    Thanks!
    Clayton Grove

    Checkout Template

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967
    Try pasting this code into a new module in your workbook.

    Please Login or Register  to view this content.
    Martin

  3. #3
    Forum Contributor
    Join Date
    02-16-2008
    Location
    Mansfield, TX
    Posts
    324
    That worked. If I wanted to change where the folders were created, what would I change? I am pretty sure that is the correct path on my work computer but not positive so I would like to be able to change it when i get there.

    Thanks!
    Clayton

  4. #4
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573
    If you wanted to get your documents folder then you can test the path and others by:
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    02-16-2008
    Location
    Mansfield, TX
    Posts
    324
    What if I do not want to save it in the default file path. What if I wanted it to be just on "C:\checkouts\2009"?

    Thanks!
    Clayton Grove

  6. #6
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967
    You would change the code like this.

    Please Login or Register  to view this content.
    and so on for the other folder creating lines.

+ 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