+ Reply to Thread
Results 1 to 2 of 2

Extracting data from multiple .xls files in folder and creating new workbook

  1. #1
    Registered User
    Join Date
    12-01-2013
    Location
    Seattle, USA
    MS-Off Ver
    Office 360
    Posts
    1

    Extracting data from multiple .xls files in folder and creating new workbook

    I created a macro to extract data from a bunch of excel files into one new workbook. When I ran the code, it didn't extract any files, but did create a blank summary file with headers. I defined the variables so that I could extract them from the workbooks. As you can see, I only need data from some columns, and I want to capture all rows of data. Am I overthinking this? (I haven't used VBA in 6 years and I was never that great at it to begin with)


    Please Login or Register  to view this content.
    Thanks for your help!

  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
    44,422

    Re: Extracting data from multiple .xls files in folder and creating new workbook

    Looks like the main problem is that you loop through all the files and, when you've finished doing that, you create the new workbook and put in headings.

    Suggest you create the new workbook first and assign it to a variable.
    Then, for each of the workbooks, determine the last row of data.
    Copy all columns between the first row of data and the last row (established above)
    Paste into the new workbook.
    When you've finished looping, delete the columns you don't need.
    Top and tail with headers and footers.
    Done.

    Regards, TMS
    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. Looping through multiple files in a folder and extracting data from a specific tab
    By Bandicoot in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-05-2013, 05:24 PM
  2. Extracting Data from Multiple Files in a Folder
    By endoskeleton in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-24-2011, 11:23 PM
  3. Importing multiple data files from one folder into one workbook
    By ArcticC in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-25-2011, 12:56 PM
  4. Extracting data from multiple workbook in folder into main workbook
    By Julesdude in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-14-2010, 11:25 AM
  5. [SOLVED] Extracting data from some files in folder
    By Alf in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-11-2006, 05:21 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