Dec 08 2022 12:30 PM
Hi there,
I am trying to create a formula that will dynamically pull in a cell's value from another workbook that is closed. I want to avoid manually referring to the source workbook, and instead want to pull in a cell's value dynamically based on a changing variable, which would be the name of the source workbooks (file name) in this case. Please considering the following
Question: What formula(s) could I use, given the above information, in cell C2 in the current workbook, that would pull cell value $C$5 from the source workbook? Note that the file path, sheet name, and cell text value would remain constant, the only variable changing is the file name.
I am trying to avoid using VBA if possible and just create a cheeky formula instead but based on my research thus far, it seems like creating a macro is the only option. I know that the INDIRECT function would work if the source workbook(s) are open, but it does not work if the workbook(s) are closed, and I want the formula to work with all the workbooks being closed. I figured I would ask the community to see there is any formula functionality that could do the trick, before having to create a macro instead.
Thanks in advance
Mike
Dec 09 2022 03:08 AM - edited Dec 09 2022 03:09 AM
Refresh an external data connection in Excel
Here are some untested examples, with formula and in VBA.
Although these examples are not tailored to your project, they may be of some help.
Don't think you can easily bypass VBA when it comes to closed workbooks.
I don't know of a safe way to do this without VBA, but if there is one, it's certainly more complicated than VBA.
zip codes | location | ||||||||||
23456 | Test2 | Examble B2 formula: =INDEX('E:\ExcelForum\[postalcodes.xlsx]Sheet1'!$B:$B,MATCH(A2,'E:\ExcelForum\[postalcodes.xlsx]Sheet1'!$A:$A,0)) |
Hope I was able to help you with this info.
I know I don't know anything (Socrates)