+ Reply to Thread
Results 1 to 6 of 6

Copying data from multiple workbooks into one

  1. #1
    Forum Contributor
    Join Date
    04-07-2013
    Location
    France
    MS-Off Ver
    Excel 2011
    Posts
    166

    Copying data from multiple workbooks into one

    Hi everyone!

    I am having a problem with the code below. I have above 1000 excel files, all of which are workbooks with one sheet. I am trying to copy data from these workbooks and paste them one after another in one new workbook in the same worksheet one after the other.

    I wrote the following code but it doesn't execute what I want.

    The data I am copying is a range of 97 rows and 5 columns from A to F. I want to copy these data into a worksheet one after the other, in a descending order.

    Would anyone be able to take a look at this code?

    Thank you in advance!

    Please Login or Register  to view this content.

  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: Copying data from multiple workbooks into one

    I could reinvent the wheel with you, but here's a ready to use macro... you need only edit the parts in red to point to your source folder...

    '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.


    Down in the section "This is the section to customize" you would make that same edit for Range("A2:E97").Copy .
    Last edited by JBeaucaire; 12-26-2019 at 04:57 PM.
    _________________
    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
    Forum Contributor
    Join Date
    04-07-2013
    Location
    France
    MS-Off Ver
    Excel 2011
    Posts
    166

    Re: Copying data from multiple workbooks into one

    I have looked at your code and I am trying it out. However I was wondering what is wrong with my code that it doesn perform the action?

    Moreover, as I try to execute it, I obtain an error telling me that the variable is not defined for msoFileDialogOpen

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    04-07-2013
    Location
    France
    MS-Off Ver
    Excel 2011
    Posts
    166

    Re: Copying data from multiple workbooks into one

    Let's say that i am trying to stack data in this format into a new worksheet
    Attached Files Attached Files

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

    Re: Copying data from multiple workbooks into one

    I apologize, after 100s of people have used the given code to accomplish this task, I'm going to defer to it rather than decipher other codes attempting to do the same thing.

  6. #6
    Forum Contributor
    Join Date
    04-07-2013
    Location
    France
    MS-Off Ver
    Excel 2011
    Posts
    166

    Re: Copying data from multiple workbooks into one

    Well, I guess I wanted to understand the error I'm making cause I agree there are many ready to use codes out there. But I understand your choice.

+ 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. Copying data from multiple workbooks to 1 master workbook
    By chilli76 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-15-2014, 12:50 PM
  2. Copying of Data from Sheet3 from multiple workbooks
    By mvinay in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-18-2013, 02:27 PM
  3. Copying data from multiple workbooks and different columns
    By amartino44 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-24-2013, 01:51 PM
  4. copying cell data from multiple workbooks - Error 400
    By polishdrumsticks in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-20-2011, 10:24 AM
  5. Help with Macro (copying data from multiple workbooks)
    By Tim Harding in forum Excel General
    Replies: 1
    Last Post: 02-05-2005, 07:06 PM

Tags for this Thread

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