+ Reply to Thread
Results 1 to 8 of 8

Create File Folder from list & create file with header row in each

  1. #1
    Forum Contributor
    Join Date
    07-17-2015
    Location
    Roanoke, Virginia
    MS-Off Ver
    2010
    Posts
    173

    Create File Folder from list & create file with header row in each

    I have a list of 600+ companies that I need to create a file folder for.
    The below macro works well to produce the folder in the directory I place my worksheet.
    I also need to place into the new folder a xlsx file with a specific name but with the same header row labels

    The attached file Test_Data.
    Column B has the folder that needs to be created
    Column D has the file that needs to be created within that folder
    F1:H1 has the header row that needs to be created in each file.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,265

    Re: Create File Folder from list & create file with header row in each

    Here you go...
    Please Login or Register  to view this content.
    Edit added red r in code...

    PS, code will only work if folder does not exist...

    Will there ever be a instance where the folder already exists and you need to do something to it?
    Last edited by sintek; 01-15-2018 at 04:52 AM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Forum Contributor
    Join Date
    07-17-2015
    Location
    Roanoke, Virginia
    MS-Off Ver
    2010
    Posts
    173

    Re: Create File Folder from list & create file with header row in each

    ran without error but nothing was created

    Did a search for the folder name but nothing.

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,265

    Re: Create File Folder from list & create file with header row in each

    Runs perfectly for me...Did you see the change in code red r
    Last edited by sintek; 01-15-2018 at 05:23 AM.

  5. #5
    Forum Contributor
    Join Date
    07-17-2015
    Location
    Roanoke, Virginia
    MS-Off Ver
    2010
    Posts
    173

    Re: Create File Folder from list & create file with header row in each

    Yes saw the 'r' - Compile error without it.

    I went back and tried again - still nothing. I reran my macro for creating a folder and it worked (then deleted the created folders)
    tried placing my Test_data in another dir and retried - still nothing

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,265

    Re: Create File Folder from list & create file with header row in each

    You do have the File that houses the macro saved somewhere?
    The code runs and creates all folders and files within at that same path...
    Works perfectly...Not sure what else it can be

  7. #7
    Forum Contributor
    Join Date
    07-17-2015
    Location
    Roanoke, Virginia
    MS-Off Ver
    2010
    Posts
    173

    Re: Create File Folder from list & create file with header row in each

    Had it saved in my PERSONAL

    Changed Test_Data to macro enabled worksheet and ran - works fine - thanks!

  8. #8
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,265

    Re: Create File Folder from list & create file with header row in each

    Glad you figured it out...Tx for rep +

+ 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. Create Folder & Check if Folder Exists if Not Create Folder & then Save File
    By Quivolt in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-28-2017, 05:31 AM
  2. [SOLVED] To create a file folder in the current workbook location and export the file
    By Ravana in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-10-2016, 07:30 AM
  3. Replies: 1
    Last Post: 08-01-2014, 05:59 AM
  4. [SOLVED] Macro to create hyperlink list of every file in a folder, subfolders
    By itmanusa in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-25-2013, 12:43 PM
  5. Macro to create hyperlink list of every file in a folder, subfolders, and SHORTCUTS
    By Billdick7788 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-20-2013, 11:11 AM
  6. Replies: 0
    Last Post: 08-23-2013, 07:57 AM
  7. Replies: 3
    Last Post: 09-30-2011, 04:35 AM

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