+ Reply to Thread
Results 1 to 7 of 7

Search multiple Excel Workbooks and get data

  1. #1
    Registered User
    Join Date
    10-11-2012
    Location
    egypt
    MS-Off Ver
    Excel 2013
    Posts
    33

    Search multiple Excel Workbooks and get data

    HI,

    I need a help to search two or more excel workbooks Data1,Data2
    and get the result in the fetchData workbook.

    how can this be achieved by vba , to search the data1 first if not found go and search in data2.
    if found it will go to another entry in the fetchdata file and do the same.

    all the files are in the same folder.


    sample files attached with a simple entries.

    thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    01-02-2020
    Location
    Idaho, USA
    MS-Off Ver
    365
    Posts
    274

    Re: Search multiple Excel Workbooks and get data

    Try this:

    Put this workbook in the same folder as your data files and run the macro. It will check the first sheet of every .xlsx file in that folder for data and put it where you want it if I understand you right. I did not test it very much, but it worked for me with the data files you attached..
    It is very range specific so you won't be able to change your starting rows or columns in the data files or this file.
    Attached Files Attached Files

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: Search multiple Excel Workbooks and get data

    try
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    10-11-2012
    Location
    egypt
    MS-Off Ver
    Excel 2013
    Posts
    33

    Re: Search multiple Excel Workbooks and get data

    thanks for reply,
    this will search data1 first for all values , if the first value (in column A) exists in the data2 it will not search the next values in data1.
    hope you got my point.

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: Search multiple Excel Workbooks and get data

    That's what the code does.

    Any problem?

  6. #6
    Registered User
    Join Date
    10-11-2012
    Location
    egypt
    MS-Off Ver
    Excel 2013
    Posts
    33

    Re: Search multiple Excel Workbooks and get data

    @jindon @achammar

    if you try both of the codes on the same data attached you will understand my problem.


    if i put 5 for example in the top of the column it will fetch the data
    if at the end it will not fetch the data.
    Attached Files Attached Files

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: Search multiple Excel Workbooks and get data

    Absolutely no idea about what you are trying to do and the files you uploaded.

+ 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. Search multiple workbooks for string - better visualisation
    By ralitsa.b in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-16-2021, 12:03 PM
  2. Macro to search text in multiple workbooks and copy data from column 2 and 4
    By Venki10 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-17-2018, 10:29 PM
  3. search for specified text in multiple workbooks
    By bharathiraja.tm in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-27-2012, 07:08 AM
  4. Need to search and display, data from multiple excel workbooks
    By spiceboy88 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-25-2012, 09:29 PM
  5. How to search multiple workbooks for a certain number
    By ryanwalton in forum Excel General
    Replies: 0
    Last Post: 10-21-2010, 08:50 AM
  6. Search for data across multiple workbooks
    By Shaunclippo in forum Excel General
    Replies: 1
    Last Post: 05-06-2008, 01:30 PM
  7. Search multiple workbooks for vba
    By robertjtucker in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-11-2006, 05:10 PM

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