Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88054

Set Excel VLOOKUP to dynamic external file

$
0
0

I've built an excel file that runs a VLOOKUP with an external file. The external file changes daily, and the naming/location of the file is dynamically set without a standard convention. So I've put together a small VBA script lets the user select the day's file, then sets the file path and file name of the xls file to look up in the table_array.
However...
Populating a cell with this data and then trying to reference that cell in the VLOOKUP is returning an error ("A value is not available to the formula or function"). If I manually input the full filepath and filename into the cell running the VLOOKUP it works fine. It seems to not understand that the value being passed in from the other cell is a real file path. Here is what I have:

B2 = fileName  (no dir path)
B3 = worksheetName
B4 = pathToFile
B5 = =CONCATENATE(B4&"["&B2&"]"&B3)
B7 = lookupValue
C7 = =VLOOKUP(B7,'B5'!$G:$I,3,FALSE)

C7 is obviously where I'm having the issue. Any and all help is greatly appreciated!


Viewing all articles
Browse latest Browse all 88054

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>