+ Reply to Thread
Results 1 to 3 of 3

Search through multiple excel files and get data

  1. #1
    Registered User
    Join Date
    11-25-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    61

    Search through multiple excel files and get data

    Hi All,

    I'm currently using the following code to "pull" a range data from a closed workbook.

    Please Login or Register  to view this content.
    This works well if I know which workbook and sheet I will be getting the info from. What I would like to do is add a function that searches through a few workbooks looking for a worksheet name that matches a value in a cell in my original workbook.

    ie. Workbook 1, cell A1 = "Jelly"

    search through excel files for the workbook that contains the worksheet named "Jelly" and then copy a range from that worksheet back to workbook 1.

    Does this make sense? Thanks for any help you can provide!
    Last edited by klunker; 03-10-2014 at 04:24 PM.

  2. #2
    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,895

    Re: Search through multiple excel files and get data

    Will the path to the folder having the workbook name in A1 always be the same?
    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

  3. #3
    Registered User
    Join Date
    11-25-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    61

    Re: Search through multiple excel files and get data

    Hi Alansidman,

    No the path will change, but it will always match the path of the master workbook. So it would be this type of format;

    C:\Users\desktop\folder1\master.xls
    C:\Users\desktop\folder1\pulldata1.xls
    C:\Users\desktop\folder1\pulldata2.xls

    So folder1 could be any name but they would always be together and they would always be in the same folder as master.xls

    I'd like to be able to have the command button in the master.xls and have the code search through pulldata1.xls and pulldata2.xls for a sheet called "Jelly" once found it would pull a range of data from that sheet, say A1:W20 (as examples).

+ 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. Replies: 0
    Last Post: 01-11-2013, 12:05 AM
  2. Search for a string in multiple excel files with multiple sheets
    By ghermanu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-13-2012, 05:46 PM
  3. Replies: 6
    Last Post: 03-08-2011, 04:08 AM
  4. How to Search content of Multiple Excel Files?
    By camrencrew in forum Excel General
    Replies: 1
    Last Post: 04-07-2010, 03:38 PM
  5. Search for text in multiple excel files
    By sc in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-13-2006, 09:45 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