+ Reply to Thread
Results 1 to 2 of 2

VBA to loop through a folder and all sub folders opening excel files.

  1. #1
    Forum Contributor
    Join Date
    10-13-2015
    Location
    California
    MS-Off Ver
    Office 2013
    Posts
    138

    VBA to loop through a folder and all sub folders opening excel files.

    Hello,

    I am looking to be able to compile a large chunk of data which is spread across hundreds of workbooks most of which only have a few lines.

    They all have the same format using (A:D)

    I would like to be able to specify a the root folder and have it loop through all the sub folders opening the excel files then copy ("A1:D" & LastRow) from that file onto a main compiled sheet.

    I do not have a problem writing the code to bring the data into an array and dump it into the main workbook my only problem is looping through all of the subfolders and opening all of the excel sheets.

    If anyone can help me with that part of the code that would be great.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    45,150

    Re: VBA to loop through a folder and all sub folders opening excel files.

    So as not to reinvent the wheel, so to speak, why not jut Google: excel vba open all files in folder. You'll get lots of examples.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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. Opening files in Excel 2013 from a folder without opening Excel first
    By Percy47746 in forum Hello..Introduce yourself
    Replies: 2
    Last Post: 01-10-2015, 07:28 AM
  2. Replies: 0
    Last Post: 10-15-2014, 04:37 AM
  3. Needs macro to copy excel files from folders, subfolders to new folder
    By genetist in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-08-2014, 08:53 AM
  4. Open ALL excel files on a folder, on different folders
    By ferrariako in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-13-2013, 09:54 PM
  5. Replies: 0
    Last Post: 07-13-2012, 10:51 PM
  6. Replies: 1
    Last Post: 02-29-2012, 01:15 PM
  7. [SOLVED] Opening Excel files in same folder through a Macro - but not subfolders?
    By toffee_madman in forum Excel General
    Replies: 9
    Last Post: 10-19-2011, 11:09 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