+ Reply to Thread
Results 1 to 10 of 10

Need to search and display, data from multiple excel workbooks

  1. #1
    Registered User
    Join Date
    06-14-2012
    Location
    Chennai,India
    MS-Off Ver
    Excel 2007
    Posts
    4

    Exclamation Need to search and display, data from multiple excel workbooks

    HI,

    Can some one help me with a VB / Macro to find a specific value from multiple excel workbooks. Below are the criteria

    1. The files will be maximum of 10 nos, and it needs to be selected / inputted by the user at the time of running the code / script
    2. the result should display , file name in one cell and the searched datas' entire row. For eg: the seach parameter is abc, it should find the text ABC in all the files chosen and display the entire row where the data is found.

    abc 1 2 abcdefgh qwerty 123 23 kaljkh ashqj


  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: Need to search and display, data from multiple excel workbooks

    1) all files are in one folder to search?
    2) the column to be searched in each file is column A?
    3) the sheet to search in each workbook is Sheet1? Multiple sheets?
    4) when we search, will "abc" be the entire cell, or might it be part of a longer string you still consider a match? abcde
    5) when the match is found somewhere along the line, can the search stop?
    _________________
    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
    Registered User
    Join Date
    03-10-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Need to search and display, data from multiple excel workbooks

    Considering yes to all your above Questions, can you please provide VB macro code, if you have.

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

    Re: Need to search and display, data from multiple excel workbooks

    Still waiting for the OP to confirm.

  5. #5
    Registered User
    Join Date
    06-14-2012
    Location
    Chennai,India
    MS-Off Ver
    Excel 2007
    Posts
    4

    Unhappy Re: Need to search and display, data from multiple excel workbooks

    Hello,

    1. Yes, the files to be searched are in a single folder
    2. No the search column is not A in all Workbooks it differs, maybe if we can specify that while selecting the files could be fine
    3. the search will be in multiple sheets
    4. the search will be from for the entire cell content, may be a pop up at the time of execution of code for longer strings could also be fine
    5. the search should not stop when it finds one match, it needs to loop until all clear match found.

    I've attached a framework as to how the macro should be. Any inputs / clarifications highly appreciated.
    Attached Files Attached Files

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

    Re: Need to search and display, data from multiple excel workbooks

    Can't say I understand the point of the File1-4 sections. You are saying you want to PREselect the files to search? Aren't we just searching all the files in a specific folder for the search string you enter?

  7. #7
    Registered User
    Join Date
    06-14-2012
    Location
    Chennai,India
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Need to search and display, data from multiple excel workbooks

    Hello Jerry,

    the initial plan was to pre-select the files, later i thought entire folder search could be easier. Either way iam ok... Either if we can workout by folder or by pre-selected files!!!!1

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

    Re: Need to search and display, data from multiple excel workbooks

    This seems to do it... just click the SEARCH button, it will prompt you for everything. Edit the macro if you wish to enter a default path for the fPATH variable prompt:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    06-14-2012
    Location
    Chennai,India
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Need to search and display, data from multiple excel workbooks

    Hmm.. wen i tried to run the macro..it prompted for string to search and location of the folder, but i didnt get any result. i've tried the whole and partial match as well.

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

    Re: Need to search and display, data from multiple excel workbooks

    Would you care to provide a couple example files that are being "searched" and the exact string you are searching for in your attempt?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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