Vlookup from another workbook which is closed

Anonymous
2017-10-22T13:15:59+00:00

Hi,

I am using vlookup in excel and fetching the data from another workbook, I want to make a cell reference for second parameter so that it could be dynamic like I can change the workbook name or the Columns. Please suggest

=VLOOKUP(A1,'C:\Users\ajay\desktop[Workbook1.xlsx]Sheet1'!$A:$B,2,0)

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Vijay A. Verma 104.7K Reputation points Volunteer Moderator
    2017-10-22T13:25:40+00:00

    Out of below what you want to keep dynamic -

    'C:\Users\ajay\desktop[Workbook1.xlsx]Sheet1'!$A:$B

    Also let me know which cells do you want to store your dynamic values...

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2017-10-22T13:33:27+00:00

    Ciao,

    for column you can use a named range and refer it into the formula:

    https://support.office.com/en-us/article/Define...

    So you can simply change the referred cells in the name range (Formulas->Name Manager) and your formula will continue working without any change.

    For workbook name is a bit more complex.

    A workaround could be just changing the name of the new workbook that you want to use to match the old one in the formula.

    A full-working solution will involve using VBA: you can assign a macro to a button that will write a function in a cell based on user-provided information.

    Please let me know if I helped you somehow or if you need further help with VBA.

    Thanks

    Ugo

    0 comments No comments
  3. Anonymous
    2018-01-06T17:45:21+00:00

    Out of below what you want to keep dynamic -

    'C:\Users\ajay\desktop[Workbook1.xlsx]Sheet1'!$A:$B

    Also let me know which cells do you want to store your dynamic values...

    The Workbook path and the Range of the worksheet

    0 comments No comments
  4. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more