+ Reply to Thread
Results 1 to 10 of 10

Create Dated Folder with Subfolder from Cell Values

  1. #1
    Registered User
    Join Date
    09-22-2014
    Location
    Los Angeles, CA
    MS-Off Ver
    2011
    Posts
    39

    Create Dated Folder with Subfolder from Cell Values

    Hi All-

    I'm fairly new to VBA code so forgive me if this is extremely simple and/or poorly worded... To note: I am on Excel 2011 for MAC. What i would like to do is create one button and assign one macro to it. I would like the macro to create a dated folder with today's date (mmddyy) and then save subfolders with the folder names determined from cells A1_B1, A2_B2, A3_B3, etc.

    So essentially the final directories would look like this:

    Macintosh HD:Users:clairephillippi:SPREADSHEET:VERSIONS:TEST:mmddyy:
    Macintosh HD:Users:clairephillippi:SPREADSHEET:VERSIONS:TEST:mmddyy:A1_B1
    Macintosh HD:Users:clairephillippi:SPREADSHEET:VERSIONS:TEST:mmddyy:A2_B2
    Macintosh HD:Users:clairephillippi:SPREADSHEET:VERSIONS:TEST:mmddyy:A3_B3

    This is the code that I am currently using. It creates folders with the date and folder name like this: 101614A1_B1

    Please Login or Register  to view this content.
    Any and all help would be greatly appreciated!!!
    Last edited by JBeaucaire; 10-16-2014 at 10:08 PM. Reason: Added missing CODE tags. Please read and follow the Forum Rules, link above in the menu bar. Thanks.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Create Dated Folder with Subfolder from Cell Values

    Maybe this:

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    09-22-2014
    Location
    Los Angeles, CA
    MS-Off Ver
    2011
    Posts
    39

    Re: Create Dated Folder with Subfolder from Cell Values

    This worked like a charm!! I have been trying for 2 days to figure this out. Thank you thank you!!

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Create Dated Folder with Subfolder from Cell Values

    As it appears you've reached a conclusion, I've marked this thread SOLVED for you.
    FYI, this is done through the Thread Tools located above the first post in this thread. Thanks.

  5. #5
    Registered User
    Join Date
    09-22-2014
    Location
    Los Angeles, CA
    MS-Off Ver
    2011
    Posts
    39

    Re: Create Dated Folder with Subfolder from Cell Values

    That helped so much, but is it possible to add another step? So the path would look like this?
    Macintosh HD:Users:clairephillippi:SPREADSHEET:VERSIONS:TEST:mmddyy:wall_A1_B1

    Thank you!!!

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Create Dated Folder with Subfolder from Cell Values

    Maybe:
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    09-22-2014
    Location
    Los Angeles, CA
    MS-Off Ver
    2011
    Posts
    39

    Re: Create Dated Folder with Subfolder from Cell Values

    That unfortunately didn't quite work. It just added the word wall to the beginning of all my folders. What I was hoping was to create 3 folders: dated folder -> wall -> folder 1


    Thank you!!

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Create Dated Folder with Subfolder from Cell Values

    That macro doesn't have the ability to create more than the one folder at the end.

    Notice how we fixed your original macro my explicitly creating the main directory before we entered to "loop"
    Please Login or Register  to view this content.
    I would think you need to do that again to add the "Wall" folder:

    Please Login or Register  to view this content.
    The rest of the original macro can remain the same, making the inside folders inside the WALL folder.

  9. #9
    Registered User
    Join Date
    09-22-2014
    Location
    Los Angeles, CA
    MS-Off Ver
    2011
    Posts
    39

    Re: Create Dated Folder with Subfolder from Cell Values

    Thank you!! That got me set on the right track. I tweaked it a little and it now does what I need it to. Thank you! Here is what I have as final macro and it works for me. I'm sure its not beautiful, but it works for me.


    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 10-21-2014 at 05:52 PM.

  10. #10
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Create Dated Folder with Subfolder from Cell Values

    That's twice I had to fix your posts and add the CODE tags... (nudge)(poke)... you can do it yourself next time, ok? Take a quick gander at the forum rules you agreed to.

+ 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] Code to create folder and inside subfolder
    By kosherboy in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 03-07-2014, 03:03 PM
  2. Create FOLDER / SUBFOLDER from CULUM
    By mash1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-13-2012, 09:29 AM
  3. Macro to Create Folder\Sub Folder\SubFolder\
    By coolhit in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-30-2012, 12:43 PM
  4. [SOLVED] Macro to create subfolder in Oultook & directory folder
    By twitch73 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-26-2012, 09:41 PM
  5. Create folder and subfolder in four layers
    By monsterdvd in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-12-2011, 05:47 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