+ Reply to Thread
Results 1 to 8 of 8

Assign Macro to button that searches multiple excel docs and retrieves specific info

  1. #1
    Registered User
    Join Date
    03-07-2017
    Location
    Stockport, England
    MS-Off Ver
    2007
    Posts
    91

    Assign Macro to button that searches multiple excel docs and retrieves specific info

    Hi All,

    I think I may have approached this problem I have all wrong and need some assistance. I have used the attached code. I am searching for an ID in each excel document, in this case the ID is "DP". It does this fine but when I try to figure out how to get the value which is in the next cell I am stumped. I think I might need to start again. Assistance would be greatly appreciated. PS "DP" is in column G in every doc and the price or value I need as well is in the next cell column H
    Please Login or Register  to view this content.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,524

    Re: Assign Macro to button that searches multiple excel docs and retrieves specific info

    Hard to test the code without a sample,

    Possibly missing .value for example
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    03-07-2017
    Location
    Stockport, England
    MS-Off Ver
    2007
    Posts
    91

    Re: Assign Macro to button that searches multiple excel docs and retrieves specific info

    HI Davesexcel, thanks for replying and your suggestion. I wasn't clear in my first post. This code does work and searches the excel docs I have instructed it to and displays the information I have asked it to search for but I know need to ask it to also show the information in the next cell across from the information it has found. I was hoping to just add a bit of code but I think the apporoach has been wrong. Any thoughts? I have attached what the code search generates.
    Attached Files Attached Files

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,524

    Re: Assign Macro to button that searches multiple excel docs and retrieves specific info

    Ah, I see.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-07-2017
    Location
    Stockport, England
    MS-Off Ver
    2007
    Posts
    91

    Re: Assign Macro to button that searches multiple excel docs and retrieves specific info

    That's brilliant, thank's davesexcel. I did a quick tweak and it displays what I need. Thanks again.
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    03-07-2017
    Location
    Stockport, England
    MS-Off Ver
    2007
    Posts
    91

    Re: Assign Macro to button that searches multiple excel docs and retrieves specific info

    Hi davesexcel I need to tweak this code a bit now. I need it to search only in a specific column in the multiple excel documents and then display the information from several columns from the same row, is that an easy tweak? EG Search for 'SM' in column A in all the excel documents and then when 'SM' is found display the information from select columns from that same row.

  7. #7
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,524

    Re: Assign Macro to button that searches multiple excel docs and retrieves specific info

    Change
    Please Login or Register  to view this content.
    to the range you want to search.
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    03-07-2017
    Location
    Stockport, England
    MS-Off Ver
    2007
    Posts
    91

    Re: Assign Macro to button that searches multiple excel docs and retrieves specific info

    Hi Davesexcel, thanks again a couple more tweaks and Ive got it to do exactly what i want. Really appreciate the 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. Macro to take embedded pdf docs in an Excel file and save to a specific location
    By theglitch in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-13-2016, 04:46 PM
  2. [SOLVED] VBA macro that searches multiple worksheets in a workbk and returns specific data to sheet
    By SKooLZ in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-17-2015, 04:42 PM
  3. Excel 2007 : How to merge 2 excel docs into multiple docs
    By T Johnson in forum Excel General
    Replies: 1
    Last Post: 06-06-2012, 12:09 PM
  4. Tweaking a macro that retrieves info from closed spreadsheet
    By kostas in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-17-2010, 07:49 AM
  5. Search Box that searches and retrieves data from another sheet
    By tommib in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-05-2009, 01:26 PM
  6. How can I cross reference 2 excel docs to look for duplicate info
    By DutchBella in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-28-2005, 01:05 PM
  7. How to assign a macro to a button in Excel 2003?
    By Mike in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-18-2005, 01:03 PM

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