+ Reply to Thread
Results 1 to 4 of 4

Looping through multiple files in a folder and extracting data from a specific tab

  1. #1
    Registered User
    Join Date
    11-29-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    46

    Looping through multiple files in a folder and extracting data from a specific tab

    Hi Guys,

    Can anyone help me with the below?

    I have a folder that has >300 spread sheets that I have saved over the years. The layout of each spread sheet is practically identical just with different data held within each.

    I would like to be able to run a macro in a new spread sheet that opens each excel file, navigates to a tab called “Volume” and then copies the data held in cells A2:E10 into the new workbook and puts the name of the file in each cell in column F next to the data that has just been copied. Once this is done, can the file be closed and then the next file opened and the same data copied to the new workbook, but in the row below the previous copy so it’s on some sort of loop until it has gone through all files in the folder?

    Is this possible?

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Looping through multiple files in a folder and extracting data from a specific tab

    http://www.rondebruin.nl/tips.htm
    If solved remember to mark Thread as solved

  3. #3
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Looping through multiple files in a folder and extracting data from a specific tab

    Will the range A2:E10 be the same for all workbooks? Also, will the row 10 be the last all the time? Or do you want it to pick up the last populated row in that file?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  4. #4
    Registered User
    Join Date
    11-29-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: Looping through multiple files in a folder and extracting data from a specific tab

    Quote Originally Posted by arlu1201 View Post
    Will the range A2:E10 be the same for all workbooks? Also, will the row 10 be the last all the time? Or do you want it to pick up the last populated row in that file?
    Yes, the range will always be a2:e10 and row 10 will always be the last row of data in all the files.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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