+ Reply to Thread
Results 1 to 1 of 1

Appending many different xls files with the same headers to one master file

  1. #1
    Registered User
    Join Date
    05-16-2013
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    1

    Appending many different xls files with the same headers to one master file

    Hello everyone,

    I'm sure my problem is quite simple, and I've found many threads requesting similar things, but somehow none of them seem to work for me.

    Here is what I want to do: loop through a folder, grabbing all the xls files with a specific string contained in them, and then put them all end to end inside of a master excel file.

    As of right now, I'm ignoring the "specific string" bit in the hopes of just getting something working. All my files have all their data on Sheet1, and all have a header row in row 1 and data starting in row 2. Files of the same type have identical header rows, and can have missing values in many columns (some are completely empty).

    My attempt so far:

    Please Login or Register  to view this content.
    This seems to copy everything on top of the previously copied files, so the contents of the last file is the only thing present in the finished product. I'm also not sure how to get the header row across.

    Out of all the different sheet categories, none have greater breadth than CT, hence I used that variable. The number of observations is variable though.

    EDIT:

    I thought that the line

    Please Login or Register  to view this content.
    Was the problem, so I tried switching it with

    Please Login or Register  to view this content.
    but that just gives me the headers. The very first column can be completely blank, so I guess that is the issue.

    I'm trying to get a handle on how range really works because I obviously don't understand it, but I haven't really found a good resource. The help page isn't that helpful. Any suggestions of somewhere to read up?

    EDIT2:

    I ran the following code:

    Please Login or Register  to view this content.
    where column B is filled for every row in this specific worksheet category. Now I get all the data, however it starts on the second row and a header row gets pasted for each import.
    Last edited by setsanto; 05-16-2013 at 10:24 AM.

+ 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