+ Reply to Thread
Results 1 to 2 of 2

I need a macro that opens all files in a folder into separate sheets of a single workbook

  1. #1
    Registered User
    Join Date
    09-01-2016
    Location
    London
    MS-Off Ver
    2016
    Posts
    3

    Question I need a macro that opens all files in a folder into separate sheets of a single workbook

    Hi all,
    As the title says, I need a macro to open all .xlsx files in a folder on a shared Z: and compile them into a single workbook as separate sheets. The file names will change each time I use the macro as will the folder (Month to month, I can go into the macro and change the directory to the new folder I assume) that the files are contained in.

    I searched and tried to use a few different ones that were written for similar situations but whenever I clicked 'Run' nothing would happen. The main difference I noted was that the people these macros were written for were opening files from their C:, although I don't see why this would make a difference.

    Let me know if there is any more information I can provide! Thank you for any help!

  2. #2
    Registered User
    Join Date
    06-13-2016
    Location
    NJ
    MS-Off Ver
    2010
    Posts
    95

    Re: I need a macro that opens all files in a folder into separate sheets of a single workb

    Try this https://www.extendoffice.com/documen...workbooks.html
    What you could do is have a prompt which ask you to choose the folder from the directory.

    That path would stay variable based upon what you choose so you can choose a different folder/path each time.
    instead of
    Path = "C:\Users\dt\Desktop\dt kte\"
    use as shown in code below
    Path = .SelectedItems(1)

    Please Login or Register  to view this content.
    Last edited by vpan; 09-01-2016 at 01:55 PM.

+ 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] Macro that opens each workbook in the folder and runs a macro
    By tsakta13ole in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-14-2016, 03:07 PM
  2. [SOLVED] merge column D from all csv files in folder to single master workbook
    By up&down in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-04-2014, 06:31 PM
  3. Macro Multiple excel files into one workbook as separate sheets
    By ian_a91 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-24-2014, 08:54 AM
  4. Copy same ranges in all excel files in a folder into a single workbook
    By ple in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-18-2013, 10:03 AM
  5. [SOLVED] Copy All Sheets From Each Workbook in Folder to a Single Sheet in New Workbook
    By DHartwig35805 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-21-2012, 03:53 PM
  6. Merging particular worksheet from Multiple Files in a folder into a single workbook
    By excelhelp18 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-30-2012, 01:37 AM
  7. [SOLVED] workbook sheets into separate files
    By Ron de Bruin in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 07:05 AM

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