+ Reply to Thread
Results 1 to 7 of 7

creating folders and subfolders using macros

  1. #1
    Registered User
    Join Date
    03-04-2014
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2010
    Posts
    7

    creating folders and subfolders using macros

    Hi, I'm new to the excel forum and have found some very helpful threads so far, but have a question of my own:

    I used this thread: http://www.excelforum.com/excel-prog...readsheet.html to create a macro that makes new file folders in my chosen directory.

    It worked great, but I want to edit it to also create the same 3 subfolders in every new folder: Correspondence, Establishment, and Financials

    How do I do this??

    Thank you in advance!

    - Mikhaela

  2. #2
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187

    Re: creating folders and subfolders using macros

    using the example Mkdir pathAndFolder is the bit that creates the folder. So all you need to do is add three extra lines with the additional folders eg: Mkdir pathAndFolder & "\Establishment"


    click on the * Add Reputation if this was useful or entertaining.

  3. #3
    Registered User
    Join Date
    03-04-2014
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: creating folders and subfolders using macros

    Thank you very much, Tony!

  4. #4
    Registered User
    Join Date
    03-04-2014
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: creating folders and subfolders using macros

    Next questions (there are 3!):

    1. How do I add a function to the macro so that if the folder already exists, it just skips over the row?
    I know it's something along the lines of:
    If (folder)=0 then

    2. How do I add a function the macro so that if the row is empty, it just skips over it?

    3. How do I change the macro so if there is something in columns E & F, it adds them as subfolders?

    Thank you in advance!!

    - Mikhaela

  5. #5
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187

    Re: creating folders and subfolders using macros

    I suggest you post the code you have so far. And don't forget to use code tags (Item 3 in Forum Rules)

  6. #6
    Registered User
    Join Date
    03-04-2014
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: creating folders and subfolders using macros

    I know it's not very neat but this is what I have so far!!
    Any help is appreciated

    Please Login or Register  to view this content.
    I need help especially with the If statements.
    I need to know what to put in there so that if there is contents in the E,G, or H cells, the folders will be created.
    Last edited by mikmez; 03-06-2014 at 08:09 PM.

  7. #7
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187

    Re: creating folders and subfolders using macros

    It is nearly one in the morning here but I will give you a quick pointer. there are various ways to test for an empty cell

    Please Login or Register  to view this content.
    or use <> for not equal

    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)

Similar Threads

  1. [SOLVED] VBA code to add folders and subfolders
    By rhlittau in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-25-2013, 06:57 PM
  2. [SOLVED] Creating Folders and Subfolders
    By matt1133 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-15-2013, 03:52 AM
  3. Listing folders and subfolders
    By brokenbiscuits in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 11-11-2011, 08:49 AM
  4. Creating folders and subfolders from excel file list
    By afaubert in forum Excel General
    Replies: 4
    Last Post: 11-08-2005, 07:50 PM
  5. [SOLVED] Traversing folders and subfolders
    By Michael in forum Excel General
    Replies: 2
    Last Post: 11-02-2005, 06:17 PM

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