+ Reply to Thread
Results 1 to 8 of 8

VBA to create folders in a directory

  1. #1
    Registered User
    Join Date
    12-24-2016
    Location
    Germany
    MS-Off Ver
    Microsoft office 2013
    Posts
    55

    VBA to create folders in a directory

    Hi)

    Can I use a VBA code to create certain folders in a directory?

    I want to create folders with the following names: 2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016.
    I also want to create subfolders in each of this folders with the following names: 01,02,03,04,05,06,07,08,09,10,11,12.

    In the following directory: O:\Countries\Data\History.

  2. #2
    Valued Forum Contributor kasan's Avatar
    Join Date
    07-22-2009
    Location
    Riga, Latvia
    MS-Off Ver
    Excel 2010
    Posts
    680

    Re: VBA to create folders in a directory

    Cross-posted: http://www.mrexcel.com/forum/excel-q...directory.html

  3. #3
    Registered User
    Join Date
    12-24-2016
    Location
    Germany
    MS-Off Ver
    Microsoft office 2013
    Posts
    55

    Re: VBA to create folders in a directory

    That is me, just need a quick answer, decided to post in two forums simultaneously.

  4. #4
    Registered User
    Join Date
    12-24-2016
    Location
    Germany
    MS-Off Ver
    Microsoft office 2013
    Posts
    55

    Re: VBA to create folders in a directory

    Am i violating a forum rule? If yes I will delete.

  5. #5
    Valued Forum Contributor kasan's Avatar
    Join Date
    07-22-2009
    Location
    Riga, Latvia
    MS-Off Ver
    Excel 2010
    Posts
    680

    Re: VBA to create folders in a directory

    Rules requires include a link to all other sources in your post.
    About subj, this should do the trick.

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    12-24-2016
    Location
    Germany
    MS-Off Ver
    Microsoft office 2013
    Posts
    55

    Re: VBA to create folders in a directory

    Cheers kasan . Works like a charm

  7. #7
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: VBA to create folders in a directory

    @Kasan
    Great code. Thanks for sharing it
    As for loop part would be
    Please Login or Register  to view this content.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  8. #8
    Valued Forum Contributor kasan's Avatar
    Join Date
    07-22-2009
    Location
    Riga, Latvia
    MS-Off Ver
    Excel 2010
    Posts
    680

    Re: VBA to create folders in a directory

    @YasserKhalil
    Thanks for feedback. Nice point with format, elegant.

+ 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. Create folders and sub folders from lists of data in excel
    By matthruba in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-30-2016, 11:28 AM
  2. [SOLVED] Code to create Folders and sub folders based on variable cell values
    By maxwell13 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-03-2015, 09:28 PM
  3. Create folders and save text files to these folders
    By bloomingcarrot in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-03-2014, 08:14 PM
  4. [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
  5. Use VBA to create hyperlinks to every file in a directory or folders and subfolders
    By Billdick7788 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-26-2012, 01:51 PM
  6. 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
  7. Create Folders in Directory with Excel VBA?
    By Jrew23 in forum Excel General
    Replies: 4
    Last Post: 06-15-2005, 11:05 PM

Tags for this Thread

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