Using VLOOKUP to Get Data From Another workbook

  • I have a problem to use vlookup in excel. I have an excel to run macro and other than i have two excel. One of them is list just a column which includes SAPkeys of people it looks like


    SAP Key
    xxxx
    yyyy
    xxxx


    and i have another excel which i use as database. in this database sap keys of all people are written in "C" column. and there are other information about that person is written in "D", "E" and "F" columns.


    what i want is bringing all information belong to sap key is written in different sheet. it would be like that after the macro run


    SAP Key Name Location
    xxx john london
    yyy
    zzzz hanks berlin


    how can i do that. thank you for help!

  • Re: Using VLOOKUP to Get Data From Another workbook


    both workbooks need to be open


    then use
    =VLOOKUP(A1,[Book1]Sheet1!$C$1:$F$300,2,FALSE)


    to pick up the other data you change the 2 to 3,4,


    Which assumes same directory
    the data is is a workbook called book1
    on sheet1
    cell range is row 1 to 300


    Where are the two files to be saved ?


    to refer to a different directory
    'C:\Reports\[Budget.xlsx]Annual'!C10:C25

    ETAF

  • Re: Using VLOOKUP to Get Data From Another workbook


    etaf, you dont need the "other" file to be open for vlookup to work, it will work on a closed file :)

    Regards


    Ford

  • Re: Using VLOOKUP to Get Data From Another workbook


    FDibbins

    thanks for the correction , it works perfectly closed - i have tried before with vlookup , but that was with an indirect function included and the sheet needed to be open ,which maybe just the indirect function


    apologies to gvdfl
    for the miss-information

    ETAF

  • Re: Using VLOOKUP to Get Data From Another workbook


    yup, indirect() does not work on closed workbooks without an addin (cant remember the name of it tho)

    Regards


    Ford

  • Re: Using VLOOKUP to Get Data From Another workbook


    morefunc - but i could not find one that worked , on windows 7 or 2010

    ETAF

  • Re: Using VLOOKUP to Get Data From Another workbook



    thanks for reply but this is not what i want. now i read what i write and it seems i was not clear :) i want to do it with macro. i open the excel workbooks by macro but i could not do what i want. this lookup codes are just part of my work that is why i want to do it with macro. thank you so much

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!