+ Reply to Thread
Results 1 to 4 of 4

Folder names from array

  1. #1
    Registered User
    Join Date
    02-08-2012
    Location
    manila, philippines
    MS-Off Ver
    Excel 2003
    Posts
    9

    Folder names from array

    Hello everyone,

    I found the code below online to create a folder using the path name that I have designated

    Please Login or Register  to view this content.
    I would need to create subfolders into the folder that the above macro create. The folder names would be pretty consistent since it would consist of employee names. I have used a loop with lbound to ubound before referencing off an array and i'm thinking this might be the way to go but writing the code properly seems to be outside of the minimal code writing skill set that I have.

    I researched it a bit but the only ones that I have found are versions of the above written code.

    Here's what I have so far before I pressed the easy button and went here. It's the same exact code as the one listed above but I included a loop with lbound to ubound. It didn't pop up any errors, which is good, but it didn't really do anything.

    Please Login or Register  to view this content.
    I'm open to suggestions on how to write this appropriately if this might not even be a smart way of going about it.

    Thanks!
    Last edited by originalJ; 03-23-2016 at 05:45 PM.

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Folder names from array

    try this code:
    Please Login or Register  to view this content.
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

  3. #3
    Registered User
    Join Date
    02-08-2012
    Location
    manila, philippines
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Folder names from array

    Perfect! Exactly what I needed.

    Just curios on this part
    Please Login or Register  to view this content.
    Just curios, what would happen if a folder with a similar name is existing? I don't it'll ever happen since the code will be naming the folder name using the date and if it does it'll be user error.

  4. #4
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Folder names from array

    If the folder already exists, it can't be created again. So this part of code will be skipped
    but the other part will still be run so the sub-folders would be created if they don't already exist.
    If you don't want to create the sub-folders if the main folder already exist, transfer that part of the code inside the If statement for the main folder.

+ 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. Requirement with folder names and file names
    By sateesh konduru in forum Excel General
    Replies: 3
    Last Post: 04-21-2015, 10:09 AM
  3. 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
  4. Need VBA Macro to extract folder names and sub folder name
    By Nanimadhu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-29-2014, 07:16 AM
  5. Folder Names in INBOX folder
    By vjharry in forum Outlook Formatting & Functions
    Replies: 3
    Last Post: 07-12-2013, 05:25 PM
  6. Excel Names in column to text files names to folder
    By excelaron in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-17-2013, 07:22 PM
  7. read in folder names and file names
    By gshock in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-11-2011, 12:45 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