+ Reply to Thread
Results 1 to 6 of 6

Cull data from multiple workbooks

  1. #1
    Registered User
    Join Date
    09-24-2012
    Location
    Chicago, Illinois
    MS-Off Ver
    Excel 2010
    Posts
    3

    Cull data from multiple workbooks

    I'm trying to make a macro similar to this that will compile a master list of parts I've ordered, who supplies them, etc. I've attached a sample of the form I want to use. I need the macro to open all the excel files I have in a folder, copy all cells except the header, and paste them into a master sheet at the nearest empty row. Here is the code I tried to use. It doesn't work, but I figured I would at least throw it out there. Any help would be greatly appreciated.

    Please Login or Register  to view this content.

    MODERATOR'S EDIT: As per forum rules, your question has been moved to a thread of its own and the CODE TAGS added to your post. Please do take a moment to read the Forum Rules (link in the menu bar above). Thanks.
    Attached Files Attached Files
    Last edited by JBeaucaire; 09-26-2012 at 04:17 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Cull data from multiple workbooks

    'WORKBOOKS TO 1 SHEET STACKED

    Here's a macro for collecting data from all files in a specific folder.The parts of the code that need to be edited are colored to draw your attention.

    As you adapt the code for your use, for instance, if you want to start at row2 in your copy, that would be a simple tweak in the
    'This is the section to customize...' area:

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    09-24-2012
    Location
    Chicago, Illinois
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Cull data from multiple workbooks

    Thanks for the help. I looked at the code you linked me to and tried to adapt it to my needs, but it opens the first file, copies it into the master workbook, then throws error 1004. When I go to debug after the error is thrown it has the
    Please Login or Register  to view this content.
    highlighted in yellow and the macro doesn't continue.

    Here is all of the code I have:

    Please Login or Register  to view this content.
    I'm a long-time excel user but new to VBA, sorry for all the questions. Unfortunately I have several hundred documents I need to compile by the end of the week and am pretty desperate to find a quick way to do it. Thanks for all the help!

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Cull data from multiple workbooks

    I would think this:
    Please Login or Register  to view this content.

    Should be:
    Please Login or Register  to view this content.
    That one line grabs all the data from A2:I(LastRowOfData) and pastes it into the summary. Notice it says copy the .EntireRow, which in this case is all of the entire rows.

  5. #5
    Registered User
    Join Date
    09-24-2012
    Location
    Chicago, Illinois
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Cull data from multiple workbooks

    Your solution is correct. Thanks a ton for your help!

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Cull data from multiple workbooks

    I have marked this thread solved for you.
    In the future please select Thread Tools from the menu above and mark the thread as solved. Thanks.

+ 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