+ Reply to Thread
Results 1 to 5 of 5

Import data from several closed workbooks to a single sheet in an open workbook

  1. #1
    Forum Contributor
    Join Date
    04-30-2009
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    496

    Import data from several closed workbooks to a single sheet in an open workbook

    Hello all.
    I have looked through the posts for help but I did not see anything I could adapt for my specific need.

    I need to import the data from a specific sheet (same named sheet on all closed workbooks) to a sheet in an open workbook. All the columns are identical in every workbook but the number of rows is variable, so the data from each subsequent workbook must be appended to the end of the current data.

    Whenever a button is pressed, this macro will clear the sheet, then import the data starting in A3. The workbooks are in different folders but they all have the same name, so some sort of explorer window will probably be needed to actually select each file.

    Any help would be appreciated.

    Thanks,
    Andrew
    Last edited by drewship; 08-05-2009 at 07:36 AM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Import data from several closed workbooks to a single sheet in an open workbook

    Hello Andrew,

    Ron De Bruin covers how do this on his site. Click on the link below to go to his page on this topic.

    Copy a range from closed workbooks (ADO)
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor
    Join Date
    02-27-2008
    Posts
    764

    Re: Import data from several closed workbooks to a single sheet in an open workbook

    Hi
    Assuming you have 10 columns and sheet name as sheet1, try the macro in the attached file. save it inside the folder containing files for data extraction. works on the contents of a single folder only. Pulls data from closed file
    ravi
    Attached Files Attached Files
    Last edited by ravishankar; 08-04-2009 at 02:08 AM.

  4. #4
    Forum Contributor
    Join Date
    04-30-2009
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    496

    Re: Import data from several closed workbooks to a single sheet in an open workbook

    Thank you Leith Ross and ravishankar. I tried both suggestions and ended up modifying one of the examples from Ron De Bruin since his code worked much faster.

    Andrew

  5. #5
    Registered User
    Join Date
    04-04-2013
    Location
    Egypt
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Import data from several closed workbooks to a single sheet in an open workbook

    Hi ravishankar
    Your Code is very effecive with me , however , when i run your code , the workbook that contains more than one sheet, show an error and asked to select which sheet to collect data from..

    Now , What if i need to run your code ONLY on sheets than named (MasterData).
    how can i change it in your code??

    And Again Many Thanks for your Support

+ 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