Using INFO("directory") to reference a workbook

babycody

Well-known Member
Joined
Jul 8, 2003
Messages
1,395
As the title suggest I would like to use INFO("directory") to reference a range in another workbook that is in the same folder as the open workbook. Is there a way to do this, and can you provide an example of the correct syntax. I have tried to tweek it in several ways, but nothing I tried seems to do the trick. Thanks!
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
As the title suggest I would like to use INFO("directory") to reference a range in another workbook that is in the same folder as the open workbook. Is there a way to do this, and can you provide an example of the correct syntax. I have tried to tweek it in several ways, but nothing I tried seems to do the trick. Thanks!
You can reference the range in the other file directly. You don't need this INFO bit.

How do you intend to use this range? Some functions don't support references to external files that are closed. (SUMIF, COUNTIF, OFFSET)
 
Upvote 0
I plan to use it with a VLOOKUP function. I want to use the INFO function so that I can incorporate it into a macro. That way the formula will always reference the folder of the workbook I have open.
 
Upvote 0
Let me know if this helps:
=VLOOKUP(A5,INFO("directory")&[printed.xls]Sheet1'!$A:$B,2,0)
 
Upvote 0
In VBA that would be something like

Code:
Range("Z1").Formula = "=VLOOKUP(A5, " & ActiveWorkbook.Path & "\[printed.xls]Sheet1'!$A:$B,2,0)"
 
Upvote 0
Thank you VoG! I had to change it slightly, because there was a space after the A5,, and I had to add an apostrophe in the first quoted area.

Code:
Range("D5").Formula = "=VLOOKUP(A5,'" & ActiveWorkbook.Path & "\[printed.xls]Sheet1'!$A:$B,2,0)"
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,299
Members
452,904
Latest member
CodeMasterX

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top