+ Reply to Thread
Results 1 to 4 of 4

Loop through folders and create folders

  1. #1
    Registered User
    Join Date
    03-11-2014
    Location
    Switzerland
    MS-Off Ver
    Excel 2010
    Posts
    37

    Loop through folders and create folders

    Hi all,
    Can anyone please help me doing the following?

    I want to open C:\Projects\
    and for each Project in Projects, create a new folder with the actual month (e.g. "03" or "12")
    Im running the Makro from a file where I'd like to put the month in a cell -> so the code refers to cell("A1") wich has value 01 and creates a folder "01" in every projectfolder in C:\Projects\

    Thank you in advance, im not getting it...

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Loop through folders and create folders

    Hi paesu57,

    See the attached file. If the file doesn't do what you want, upload a sample file, and the code can probably be adapted to your file.

    Lewis

  3. #3
    Registered User
    Join Date
    03-11-2014
    Location
    Switzerland
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: Loop through folders and create folders

    Hi Lewis,
    Thank you very much! the file works. but i am a little bit confused about how complex it seems. Im now trying to make the code simpler, as it does no need to be very dynamic... it's always the same and all the "IFs" to check something are not needed.
    But thank you very much, I appreciate your work!
    BR Pascal

  4. #4
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Loop through folders and create folders

    Hi,

    I'm glad it works for you. Feel free to remove anything you want, and if you need help, I'll be glad to simplify the program, if I know what you want. A lot of the 'defensive programming ifs' were put in when I entered an incorrect option.

    I do my best to avoid 'runtime errors' under most normal circumstances.

    Lewis

+ 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] Create folders and Sub folders and Sub-Sub folders from 5 columns with VBA
    By arleutwyler in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-11-2014, 04:16 PM
  2. [SOLVED] Opening folders inside of folders and pulling data from sheets present.
    By randomguy1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-09-2013, 10:57 PM
  3. Replies: 1
    Last Post: 09-12-2013, 09:23 PM
  4. Replies: 0
    Last Post: 12-04-2012, 01:01 PM
  5. Create folders and move and copy files into that folders
    By vijaybharthi in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-31-2010, 04:01 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