+ Reply to Thread
Results 1 to 6 of 6

Creating Folders and Subfolders based off Column A and B

  1. #1
    Registered User
    Join Date
    10-12-2015
    Location
    USA
    MS-Off Ver
    Office 2013
    Posts
    5

    Creating Folders and Subfolders based off Column A and B

    I have an excel spreadsheet with quite a long list of codes (IE: 3235, 3242, etc) in column B a type (GRD, CYU, etc) next to it
    We are trying to set up a folder structure based off this , alas there is over 1000 listings here.
    Our folder structure is going to look like this
    Main > Second > Column A > Column B > Docs ... This means I need to have a macro detect the items in column A, create the folder named after it, and add the column B item next to it as the subfolder.
    The other issue I run into is repeating lines. The way the document is organized is say we have location 3226..it is listed 5 times (in order mind you) for 5 different types (HMO, EPL, etc). So I need it to detect if the folder is already created, and add those 5 subfolders underneath the main folder (I dont want 3226 created 5 times)

    an example of my document is as such
    2089 HAW
    2089 HPL
    2089 HUN
    2093 ECE
    2094 DKU
    2100 DFD
    2100 DLX
    2100 ECD
    2100 EEO
    2100 EIY
    2100 EMR
    2100 EZI
    2101 GBQ
    2108 ALN
    2113 HCE
    2134 AAQ
    2159 AFJ

    As you can see the 2100 would need 7 subfolders created under it. So that is just the first step

    Also can I get a minor code to add a blank "new text.txt" document at the end of ALL these subfolder trees? It is for uploading purposes.
    Last edited by Sdthaman; 10-13-2015 at 09:01 AM.

  2. #2
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2505
    Posts
    2,790

    Re: Creating Folders and Subfolders based off Column A and B w/ doc at end

    Would you please post a sample sheet so we don't have to make one.

  3. #3
    Registered User
    Join Date
    10-12-2015
    Location
    USA
    MS-Off Ver
    Office 2013
    Posts
    5

    Re: Creating Folders and Subfolders based off Column A and B w/ doc at end

    At the moment the macro I have works well for just 1 folder....but I'm not sure it can be modified to add subfolders...but if you insist
    Please Login or Register  to view this content.
    I don't mind if a new VBA code be created that may be simpler. This code opens up a GUI interface for me to choose where to create the highlighted files I ran the macro over.
    The excel document itself is in the format I showed you before....sept 1000 rows long

    0501 CHB
    0501 CRX
    0503 CHF
    0506 CHG
    0508 BFA
    0513 CHD
    0528 CHA
    0537 BEM
    0562 HNT
    0565 HNP
    0565 HTE
    0596 ACQ
    0609 DKA
    0609 DRC
    0609 DRD
    0622 BEY
    0636 EMO
    0654 FPE
    0655 BFG
    0663 BEG
    0679 GQB
    0689 DJY

    With the entity being under column A, and the proc under column B. If column A is repeated (like the 0501) the CHB and CRX needs to be 2 subfolders under the folder "0501"
    I know its hard to explain >.<
    Last edited by Leith Ross; 10-12-2015 at 06:48 PM. Reason: Added Code Tags

  4. #4
    Registered User
    Join Date
    10-12-2015
    Location
    USA
    MS-Off Ver
    Office 2013
    Posts
    5

    Re: Creating Folders and Subfolders based off Column A and B w/ doc at end

    Anyone know anything?

  5. #5
    Registered User
    Join Date
    10-12-2015
    Location
    USA
    MS-Off Ver
    Office 2013
    Posts
    5

    Re: Creating Folders and Subfolders based off Column A and B w/ doc at end

    I have a headache from staring at code all day and not making any progress >.<

  6. #6
    Registered User
    Join Date
    10-12-2015
    Location
    USA
    MS-Off Ver
    Office 2013
    Posts
    5

    Re: Creating Folders and Subfolders based off Column A and B w/ doc at end

    In the end this code ended up working...finally
    Please Login or Register  to view this content.
    It creates it under my C drive but I can drag and drop where I wanted it from there. I know I can probably modify it to put it under the folder I want but was honestly just to tired to. If anyone else needs it enjoy.
    Last edited by Leith Ross; 10-12-2015 at 06:49 PM. Reason: Added Code Tags

+ 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] creating folders and subfolders
    By Lohara005 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-13-2015, 07:28 AM
  2. Create folders in all the subfolders and move subfolders
    By Amarjeet Singh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-24-2015, 12:51 PM
  3. creating folders and subfolders using macros
    By mikmez in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-06-2014, 08:45 PM
  4. [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
  5. [SOLVED] Creating Folders and Subfolders
    By matt1133 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-15-2013, 03:52 AM
  6. Creating folders and subfolders from excel file list
    By afaubert in forum Excel General
    Replies: 4
    Last Post: 11-08-2005, 07:50 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