+ Reply to Thread
Results 1 to 4 of 4

Poulate a cell in one workbook with data from a variable row in another workbook

  1. #1
    Registered User
    Join Date
    11-15-2014
    Location
    Bournemouth
    MS-Off Ver
    2010
    Posts
    8

    Poulate a cell in one workbook with data from a variable row in another workbook

    Hi everyone.

    I'd greatly appreciate any help that anyone may be able to afford a total newcomer!

    My problem is this:

    I'd like to populate the data in a cell in one workbook with data from a fixed column of a variable row in another workbook.

    So I have workbook 1:
    1.JPG


    And I have another workbook (workbook 2):
    WOR3.JPG



    Now, in cell D2 , I'd like to populate data from workbook 1 cell B4. However - the row that the data (Beth's data) appears in within workbook 1 varies - so some weeks, Beth's data will be in row 4, some weeks row 6, some weeks row 36! - this is because the different people in workbook 1 will vary day to day/week to week, etc. (in truth - the data in workbook 1 is exported from a piece of software and I have no controlover the number of rows that will appear or of what row any given person will be on)

    So what I really need is a way to tell workbook 2, cell D2 to find data from workbook 1, column D and whatever row contains the value 'Beth' in column B.

    Is this even possible?

    Many thanks for any help

  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: Poulate a cell in one workbook with data from a variable row in another workbook

    VLOOKUP() will work on external workbooks, as your columns are set I would recommend using that function.

    Create your VLOOKUP with both workbooks open. Then close the external workbook and the VLOOKUP will expand its references to include the full path to the document, as well as the sheet/column references you already setup. It should keep working from that point on.
    _________________
    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
    11-15-2014
    Location
    Bournemouth
    MS-Off Ver
    2010
    Posts
    8

    Re: Poulate a cell in one workbook with data from a variable row in another workbook

    Awesome, many thanks for your help JBeaucaire- I've learnt how to use vlookup and it's the perfect solution to my problem. Thanks again

  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: Poulate a cell in one workbook with data from a variable row in another workbook

    As it appears you've reached a conclusion, I've marked this thread SOLVED for you.
    FYI, this is done through the Thread Tools located above the first post in this thread. Thanks.

+ 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. [SOLVED] Copy/paste data from one workbook to another but workbook name variable
    By Jiptastic in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-11-2013, 12:14 PM
  2. Saving workbook as notepad using cell data for filename & retaining original workbook name
    By peterkerr_13 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-26-2012, 08:07 AM
  3. [SOLVED] Open Workbook, hidden, get cell data into a variable
    By Bruce Tjosvold in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-12-2012, 04:27 PM
  4. Replies: 1
    Last Post: 04-01-2006, 03:50 PM
  5. Replies: 4
    Last Post: 03-13-2006, 12:25 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