+ Reply to Thread
Results 1 to 7 of 7

Create new sub folder

  1. #1
    Forum Contributor
    Join Date
    11-01-2012
    Location
    NJ
    MS-Off Ver
    Excel 365
    Posts
    109

    Create new sub folder

    Hello,

    Does anyone know a quick code to create a sub folder under the parent directory listed in column A.
    I have about 600 different parent directories in column A and the new folder I need to create is in the corresponding row next to it in Column B. column B names are all different as well. I want to check if the new folder exists listed in column B already and if it doesn't create a new folder. If it does already exist, move on. Anyone know a quick way to do this?

    Thanks!!!

  2. #2
    Valued Forum Contributor
    Join Date
    09-17-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    454

    Re: Create new sub folder

    This will create all the sub paths necessary to fulfill the DestPath:
    Please Login or Register  to view this content.

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

    Re: Create new sub folder

    @cyiangou
    I think there is error in this udf function
    Can you guide us how to use it?
    Thanks advanced
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  4. #4
    Forum Contributor
    Join Date
    11-01-2012
    Location
    NJ
    MS-Off Ver
    Excel 365
    Posts
    109
    Quote Originally Posted by cyiangou View Post
    This will create all the sub paths necessary to fulfill the DestPath:
    Please Login or Register  to view this content.
    Shouldn't this be a Sub and not a function? I can not get this to work

    Thanks

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

    Re: Create new sub folder

    Suppose your data in column A and sub folders names in column B
    Try this code
    Please Login or Register  to view this content.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Create new sub folder

    Here's what I use:

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Valued Forum Contributor
    Join Date
    09-17-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    454

    Re: Create new sub folder

    @cyiangou
    I think there is error in this udf function
    Can you guide us how to use it?
    Just call it like this:
    Please Login or Register  to view this content.
    it should build all the levels if they don't exist.

    Shouldn't this be a Sub and not a function? I can not get this to work
    It's configured as a function if you want to get success/failure info from it, but just call it like a sub.

    It should work perfectly. This particular proc I have used unchanged for almost 20 years (as evidenced by my 2 space indentation).

+ 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] Loop Through Folder, Create Emails with Sub Folder Names in Subject, Attach files in sub
    By Rschwar23 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-30-2015, 10:06 AM
  2. Create FOLDER in subfoldesr and move folders with specific names into FOLDER
    By Amarjeet Singh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-25-2015, 09:46 AM
  3. Code to create New Folder (if doesn't exist) and then Save Workbook to folder
    By jenhawley in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-10-2013, 03:09 PM
  4. Replies: 13
    Last Post: 06-04-2012, 02:18 PM
  5. create a compressed folder or zipped folder then copy workbooks to it.
    By Ironman in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-04-2012, 03:56 PM
  6. Create Folder with system date then save file to folder
    By cartotech81 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-06-2009, 02:12 PM
  7. Replies: 6
    Last Post: 08-11-2006, 03:41 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