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...
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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)
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.
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...
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
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
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