+ Reply to Thread
Results 1 to 4 of 4

Search worksheet in another workbook and pull matching Data

  1. #1
    Registered User
    Join Date
    01-21-2015
    Location
    Altrincham, England
    MS-Off Ver
    2010
    Posts
    6

    Search worksheet in another workbook and pull matching Data

    Hi all,

    I am trying to code a function into a userform whereby when someone enters an account number (accountnumber_Change()) it searches a worksheet for that account number and if found pulls the order number requirement (which is in the cell next to it) from that worksheet and displays it in the userform.

    I have code that is working but it searches a worksheet in the same workbook as the userform. I am wanting to change it so it searches a worksheet in another workbook.

    The second workbook I have is called 'Authorisation_Log.xlsx' and the worksheet is called 'Order Format'

    Any help is greatly appreciated.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Search worksheet in another workbook and pull matching Data

    Maybe:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-21-2015
    Location
    Altrincham, England
    MS-Off Ver
    2010
    Posts
    6

    Re: Search worksheet in another workbook and pull matching Data

    Hi John,

    Thanks for your help.

    It was nearly right for me, had to change a few things,

    I had to add .Open to the 'Set ws = Workbooks.Open("...\Authorisation_Log.xlsx").Sheets("Order Format")' and had to add 'End With'.

    ended up with:

    Please Login or Register  to view this content.

    How can I get it to search this work book without it opening?

  4. #4
    Registered User
    Join Date
    09-10-2014
    Location
    Matrix
    MS-Off Ver
    2010
    Posts
    70

    Re: Search worksheet in another workbook and pull matching Data

    erjp, if you want to search this workbook without opening it use ADODB. Here you can find some interesting information https://support.microsoft.com/en-us/kb/257819

    Also if you stay with Open method you can off the screening mode. Just add to your code:
    Please Login or Register  to view this content.
    Last edited by michson; 05-28-2015 at 05:09 AM.
    (*) Reputation points appreciated.
    excelbs.tk

+ 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. Formula to search for matching data in a seperate workbook.
    By Adampc in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-06-2014, 09:23 AM
  2. Replies: 8
    Last Post: 05-03-2013, 12:26 PM
  3. How do I pull in data from numerous worksheets onto the master worksheet in a workbook?
    By DRE_VAR777 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-11-2013, 12:07 PM
  4. insert data from child workbook to master workbook by search matching records
    By jjgal767 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-21-2011, 05:10 AM
  5. Pull data from another worksheet based on multilpe search criteria
    By spectrum in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-30-2005, 02:27 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