+ Reply to Thread
Results 1 to 7 of 7

Pulling data into multiple cells from a Database in seperate workbook based on 1 criteria

  1. #1
    Registered User
    Join Date
    09-28-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    12

    Question Pulling data into multiple cells from a Database in seperate workbook based on 1 criteria

    So what i am looking to do is create 2 linked workbooks

    1. which will be a database of items.

    2. will be a form that calls details from the database when i type 1 criteria (in this example the invoice number).



    e.g

    in my database i have data for 'invoice number | price | length | region'.

    in another workbook i want the various items such as price length and region to auto fill in designated cells having typed the invoice number into the first cell.

    any suggestions as to the best method for this?

  2. #2
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: Pulling data into multiple cells from a Database in seperate workbook based on 1 crite

    Here's the code written by JieJenn yesterday. He/She wrote a code that's doing something similar to what youre asking for, except the 2 sheets are in the same workbook.

    I've altered the code a bit to work on two workbooks. There are many open questions remaining about your inquiry(are both files open, will the names always be the same, which range is supposed to be copied etc.). The code works - you can change it complete your needs. If you don't know how, I can give it a try, but please attach an example of what needs to be done where first :0

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-28-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Pulling data into multiple cells from a Database in seperate workbook based on 1 crite

    Thank you for the fast response, Both files will be Open database probably via a network and keep the same names.

    Attached examples

    Database.xlsx

    Form.xlsx

    Regards.

  4. #4
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: Pulling data into multiple cells from a Database in seperate workbook based on 1 crite

    Ah, your problem is somewhat different i see. Why don't you use a simple formula then (instead of vba?).

    Form.xlsx

    Like the one attached. If you need a vba procedure for any reason, I'll get one for you in an hour as I'm leaving work now

  5. #5
    Registered User
    Join Date
    09-28-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Pulling data into multiple cells from a Database in seperate workbook based on 1 crite

    This is great, exactly what I'm trying to achieve.

    i do find myself trying to make things more complicated than they have to be.

    Do you think you could give me a quick rundown of the method you have used to get to this point.

    =IFERROR(VLOOKUP(B3,[Database.xlsx]Sheet1!$A$2:$D$23,2,FALSE),B3 &" Not found")

    i understand everything up until !$A$2:$D$23 what does this range do, i get the 2 is column 2 and false for an exact match but the range baffles me, i have seen the $A before which i believe is the prefix for finding data from another source?

    Thank you

  6. #6
    Registered User
    Join Date
    01-25-2014
    Location
    Ohio, United States
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Pulling data into multiple cells from a Database in seperate workbook based on 1 crite

    I'm trying to do the same thing. I've made a spreadsheet to verify my pay. I get paid on piece work. The amount of work I do is converted to points which is divided by the incentive hours I worked, This gives me a points per hour which is converted into a monetary rate. This scale is on the "Pay Scale" tab. On the "Template" tab, G3 gives me my hourly point rate. I want H3 to automaticly pull from "Pay Scale" the corresponding rate in Template G3. So if G3 = 71 I want H3 to pull Pay Scale B8 ($12.27) over. I tried using a Nested formula but it wouldn't allow me to put in enough entries. I will format the pay chart back into 2 columns if it makes it easier for the formula. The only reason I formatted it more like a table was so that I didn't have to scroll as much when I went looking for the corresponding rate to manually enter it into H3.

    Note: If you look at sheet 1 you will see how I copy and paste the template for each new week, and see how the sheet works with data entered if it helps. Also, there are a couple other place where the point rate is calculated. I don't need the pay rate next to these yet, except maybe next to the first AHE C9. If for some reason the formula will be different in each location then I need both.

    Note:I did all this spread sheet myself. But that's just about the extent of my knowledge. As I mentioned the nested formula above, I just learned that yesterday. And it took reading an example my Stepdad sent, reading help files, and experimenting.
    If the answer is the same you gave the OP
    =IFERROR(VLOOKUP(B3,[Database.xlsx]Sheet1!$A$2:$D$23,2,FALSE),B3 &" Not found")
    Then I have no idea what any of that is.
    No matter what the answer is if you could take the time to explain it to me instead of just giving me the formula that would be greatly appreciated
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    01-25-2014
    Location
    Ohio, United States
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Pulling data into multiple cells from a Database in seperate workbook based on 1 crite

    I got it
    =VLOOKUP(G3,'Pay Scale'!A1:B137,2)
    I little more digging was all I needed

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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