+ Reply to Thread
Results 1 to 12 of 12

Import data from adjacent workbooks

  1. #1
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Import data from adjacent workbooks

    Hello
    I hope to find a quick solution of my request please as I need it at once

    I have four workbooks in the same folder
    One named (Summary) this is where I want to import data .. In this WB there is a table already done ...
    All what I want to do to import data from other adjacent workbooks (Test1 - Test2 - Test3) from sheet named with the same name in these workbooks named (Export).

    In WB(Summary) Row (10) to be copied from WB(Test1)/Sheet(Export) Row(10) as source.
    In WB(Summary) Row (11) to be copied from WB(Test2)/Sheet(Export) Row(10) as source.
    In WB(Summary) Row (12) to be copied from WB(Test3)/Sheet(Export) Row(10) as source.

    Here's an attachment
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Import data from adjacent workbooks

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Import data from adjacent workbooks

    Thanks sir for help
    Your code seems to be as a result of recording macros
    The problem is that the number of the adjacent workbooks to the main WB (Summary) is variable >> may be four five or six as a a maximum
    And I want to paste as values because these ranges contain formulas

    Another important point is that source WBs should be closed .. Copying should be from closed workbooks
    Hope it is clear now

  4. #4
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Import data from adjacent workbooks

    I need this code for my work please help me ..

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Import data from adjacent workbooks

    Are all the workbooks in the same folder directory? Are there any workbooks in the same folder that should not be included in your copy and paste procedure?
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  6. #6
    Forum Contributor
    Join Date
    09-11-2013
    Location
    Germany
    MS-Off Ver
    Excel 2007
    Posts
    265

    Re: Import data from adjacent workbooks

    Paste this into a standard module:

    Please Login or Register  to view this content.
    Dont forget to change the Folder addresses....

    1. Assumes that the Source Files will be called "Test.........."

    2. Assumes that when you run the Macro The Cells in the Destination File (Summary) Are empty or can be overwritten.

    3. There can be any number of Source Files.

    4. Macro will loop through all Source files untill they have all be added to summary file.


    Alt+F8 and run macro...
    Last edited by JRidge; 11-01-2014 at 12:22 PM.

  7. #7
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Import data from adjacent workbooks

    Thanks for offering help Sir
    I tested the code but there are errors .. I declared variables and tested again but nothing happened..
    I thought files should be open so I opened them and test the code again and nothing happened

  8. #8
    Forum Contributor
    Join Date
    09-11-2013
    Location
    Germany
    MS-Off Ver
    Excel 2007
    Posts
    265

    Re: Import data from adjacent workbooks

    I have fully tested this with your Data and it all Works.

    What errors are you getting?

    Have you changed the Address of folder like instructed?

  9. #9
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Import data from adjacent workbooks

    Thank you very much
    It worked now efficiently..
    Just one point to complete this wonderful code
    I don't want to be bounded to specific path . In other words I want to import data from the files in the same folder without using the path
    C:\Users\JeRi\Desktop\New Project\

    Thanks advanced

  10. #10
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Import data from adjacent workbooks

    Briefly I want to do that in the same path without typing full path to be able to use it in any directory

  11. #11
    Forum Contributor
    Join Date
    09-11-2013
    Location
    Germany
    MS-Off Ver
    Excel 2007
    Posts
    265

    Re: Import data from adjacent workbooks

    This will use the current location of the summary workbook as the Path:

    Please Login or Register  to view this content.
    If this Solution answers your Question then please mark this Thread as "Solved".

    Top of Thread under "Thread Tools"

    Also if you think i have helped please remember to add a bit of Reputation. Use the * in the Bottom Left of my Posts...

    Have a nice Weekend.

    Regards

    JRidge

  12. #12
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Import data from adjacent workbooks

    Thank you very much for your help

+ 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. [SOLVED] Retrieving non adjacent data from other workbooks?
    By bj in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-06-2005, 11:05 AM
  2. [SOLVED] Retrieving non adjacent data from other workbooks?
    By Sue in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  3. Retrieving non adjacent data from other workbooks?
    By Sue in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  4. [SOLVED] Retrieving non adjacent data from other workbooks?
    By Sue in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  5. Retrieving non adjacent data from other workbooks?
    By Sue in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-24-2005, 07:05 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